glibc/sysdeps
Florian Weimer 33adeaa3e2 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>
(cherry picked from commit 2849e2f533)
2021-09-23 11:02:19 +02:00
..
aarch64 glibc.malloc.check: Wean away from malloc hooks 2021-07-22 18:38:08 +05:30
alpha
arc ARC: elf: make type safe 2021-07-21 13:13:45 -07:00
arm nptl: Remove remaining code from libpthread 2021-05-21 22:35:01 +02:00
csky
generic mtrace: Wean away from malloc hooks 2021-07-22 18:38:06 +05:30
gnu hurd: Fix glob lstat compatibility 2021-07-22 20:31:52 +02:00
hppa
htl htl: Do not expose pthread hidden proto outside libpthread 2021-07-18 20:25:33 +00:00
hurd
i386 i386: Regenerate ulps 2021-07-25 22:29:27 +02:00
ia64 nptl: Remove remaining code from libpthread 2021-05-21 22:35:01 +02:00
ieee754 Update math: redirect roundeven function 2021-06-27 07:56:57 -07:00
m68k
mach hurd: _Fork: unlock malloc before calling fork child hooks 2021-07-27 02:03:01 +02:00
microblaze
mips Update MIPS libm-test-ulps 2021-07-07 15:50:18 +00:00
nios2
nptl nptl: Fix type of pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust_np (bug 28036) 2021-09-21 07:15:25 +02:00
posix gaiconf_init: Avoid double-free in label and precedence lists 2021-08-04 15:53:46 +05:30
powerpc Force building with -fno-common 2021-07-09 20:09:14 +02:00
pthread nptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361] 2021-09-23 11:02:19 +02:00
riscv RISC-V: Update rv64 ULPs 2021-07-21 08:44:09 +02:00
s390 s390: Fix MEMCHR_Z900_G5 ifunc-variant if n>=0x80000000 [BZ #28024] 2021-07-01 16:46:59 +02:00
sh
sparc nptl: Remove remaining code from libpthread 2021-05-21 22:35:01 +02:00
unix Use support_open_dev_null_range io/tst-closefrom, misc/tst-close_range, and posix/tst-spawn5 (BZ #28260) 2021-09-21 22:26:26 +12:00
wordsize-32
wordsize-64
x86 x86-64: Add Avoid_Short_Distance_REP_MOVSB 2021-07-28 13:23:57 -07:00
x86_64 x86-64: Use testl to check __x86_string_control 2021-08-31 08:09:25 -07:00