glibc/sysdeps
Florian Weimer 2849e2f533 nptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361]
As part of the fix for bug 12889, signals are blocked during
thread exit, so that application code cannot run on the thread that
is about to exit.  This would cause problems if the application
expected signals to be delivered after the signal handler revealed
the thread to still exist, despite pthread_kill can no longer be used
to send signals to it.  However, glibc internally uses the SIGSETXID
signal in a way that is incompatible with signal blocking, due to the
way the setxid handshake delays thread exit until the setxid operation
has completed.  With a blocked SIGSETXID, the handshake can never
complete, causing a deadlock.

As a band-aid, restore the previous handshake protocol by not blocking
SIGSETXID during thread exit.

The new test sysdeps/pthread/tst-pthread-setuid-loop.c is based on
a downstream test by Martin Osvald.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-09-23 09:56:07 +02:00
..
aarch64 elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
alpha elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
arc elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
arm elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
csky elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
generic ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340] 2021-09-22 11:12:43 -07:00
gnu Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
hppa elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
htl htl: Reimplement GSCOPE 2021-09-16 01:04:17 +02:00
hurd
i386 Add narrowing fma functions 2021-09-22 21:25:31 +00:00
ia64 Add narrowing fma functions 2021-09-22 21:25:31 +00:00
ieee754 Add narrowing fma functions 2021-09-22 21:25:31 +00:00
m68k elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
mach Add narrowing fma functions 2021-09-22 21:25:31 +00:00
microblaze elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
mips ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340] 2021-09-22 11:12:43 -07:00
nios2 elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
nptl nptl: Fix type of pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust_np (bug 28036) 2021-09-21 07:13:05 +02:00
posix Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
powerpc Add narrowing fma functions 2021-09-22 21:25:31 +00:00
pthread nptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361] 2021-09-23 09:56:07 +02:00
riscv Add narrowing fma functions 2021-09-22 21:25:31 +00:00
s390 elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
sh elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
sparc Add narrowing fma functions 2021-09-22 21:25:31 +00:00
unix Add narrowing fma functions 2021-09-22 21:25:31 +00:00
wordsize-32
wordsize-64 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
x86 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
x86_64 Add narrowing fma functions 2021-09-22 21:25:31 +00:00