[Bug libc/22685] New: PowerPC: Static AT_SECURE binaries segfault with lock-elision and tunables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/22685] New: PowerPC: Static AT_SECURE binaries segfault with lock-elision and tunables

cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22685

            Bug ID: 22685
           Summary: PowerPC: Static AT_SECURE binaries segfault with
                    lock-elision and tunables
           Product: glibc
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: aurelien at aurel32 dot net
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Since the introduction of tunables in commit 67e58f39 (which is in 2.25) and
when the GNU libc is configured with --enable-tunables
--enable-lock-elision=yes the stdlib/tst-secure-getent test fails with
segmentation fault. This is also true for elf/tst-env-setuid and
elf/tst-env-setuid-tunables that has been added a few commits later.

Note that since glibc 2.26 tunables are enabled by default and since commit
07ed18d2 (which will be in 2.27) lock elision support is always compiled.

The issue comes from the use of __access_noerrno in maybe_enable_malloc_check
in elf/dl-tunables.c to check for /etc/suid-debug. On PowerPC, transactions are
aborted just before syscalls, by using this code from sysdeps/powerpc/sysdep.h:

#if !IS_IN(rtld)
# define ABORT_TRANSACTION \
  ({                                            \
    if (THREAD_GET_TM_CAPABLE ())               \
      __libc_tabort (_ABORT_SYSCALL);   \
  })
#else
# define ABORT_TRANSACTION
#endif

The problem is that on static binaries __thread_register is not yet initialized
when maybe_enable_malloc_check is executed, causing a segmentation fault. Just
removing the __access_noerrno test workarounds the issue.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/22685] PowerPC: Static AT_SECURE binaries segfault with lock-elision and tunables

cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22685

Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tuliom at linux dot vnet.ibm.com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/22685] PowerPC: Static AT_SECURE binaries segfault with lock-elision and tunables

cvs-commit at gcc dot gnu.org
In reply to this post by cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22685

Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tuliom at linux dot vnet.ibm.com

--- Comment #1 from Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> ---
Patch sent to libc-alpha.

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