public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/27721] New: x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily
@ 2021-04-12  8:34 nsz at gcc dot gnu.org
  2021-04-15  8:48 ` [Bug dynamic-link/27721] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2021-04-12  8:34 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27721

            Bug ID: 27721
           Summary: x86: ld_audit ignores bind now for TLSDESC and tries
                    resolving them lazily
           Product: glibc
           Version: 2.33
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

TLSDESC cannot be relocated lazily in a module that
was linked bind now, because the DT_TLSDESC_PLT and
DT_TLSDESC_GOT entry points are missing.

ldaudit should not ignore bind now in _dl_relocate_object:

  /* If DT_BIND_NOW is set relocate all references in this object.  We
     do not do this if we are profiling, of course.  */
  // XXX Correct for auditing?
  if (!consider_profiling
      && __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0))
    lazy = 0;

i plan to remove lazy tlsdesc support (see bug 27137) that
makes this problem go away (except when bind now is used
semantically to mean lazy relocation is unsupported e.g. by
plt calls that don't follow the pcs). alternative fix would
be to change all linkers to always emit the lazy tlsdesc
entry with bind now for ldaudit to work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug dynamic-link/27721] x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily
  2021-04-12  8:34 [Bug dynamic-link/27721] New: x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily nsz at gcc dot gnu.org
@ 2021-04-15  8:48 ` cvs-commit at gcc dot gnu.org
  2021-04-15 10:47 ` nsz at gcc dot gnu.org
  2021-04-15 10:48 ` nsz at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-15  8:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27721

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Szabolcs Nagy <nsz@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f7e09f4dbdb5c815a18b8285fbc5d5d7bc17d86

commit 8f7e09f4dbdb5c815a18b8285fbc5d5d7bc17d86
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Feb 11 11:29:23 2021 +0000

    x86_64: Avoid lazy relocation of tlsdesc [BZ #27137]

    Lazy tlsdesc relocation is racy because the static tls optimization and
    tlsdesc management operations are done without holding the dlopen lock.

    This similar to the commit b7cf203b5c17dd6d9878537d41e0c7cc3d270a67
    for aarch64, but it fixes a different race: bug 27137.

    Another issue is that ld auditing ignores DT_BIND_NOW and thus tries to
    relocate tlsdesc lazily, but that does not work in a BIND_NOW module
    due to missing DT_TLSDESC_PLT. Unconditionally relocating tlsdesc at
    load time fixes this bug 27721 too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug dynamic-link/27721] x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily
  2021-04-12  8:34 [Bug dynamic-link/27721] New: x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily nsz at gcc dot gnu.org
  2021-04-15  8:48 ` [Bug dynamic-link/27721] " cvs-commit at gcc dot gnu.org
@ 2021-04-15 10:47 ` nsz at gcc dot gnu.org
  2021-04-15 10:48 ` nsz at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2021-04-15 10:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27721

Szabolcs Nagy <nsz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.34

--- Comment #2 from Szabolcs Nagy <nsz at gcc dot gnu.org> ---
fixed for 2.34

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug dynamic-link/27721] x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily
  2021-04-12  8:34 [Bug dynamic-link/27721] New: x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily nsz at gcc dot gnu.org
  2021-04-15  8:48 ` [Bug dynamic-link/27721] " cvs-commit at gcc dot gnu.org
  2021-04-15 10:47 ` nsz at gcc dot gnu.org
@ 2021-04-15 10:48 ` nsz at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2021-04-15 10:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27721

Szabolcs Nagy <nsz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Szabolcs Nagy <nsz at gcc dot gnu.org> ---
fixed for 2.34

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-15 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  8:34 [Bug dynamic-link/27721] New: x86: ld_audit ignores bind now for TLSDESC and tries resolving them lazily nsz at gcc dot gnu.org
2021-04-15  8:48 ` [Bug dynamic-link/27721] " cvs-commit at gcc dot gnu.org
2021-04-15 10:47 ` nsz at gcc dot gnu.org
2021-04-15 10:48 ` nsz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).