glibc/sysdeps
Florian Weimer abeae3c006 Linux: Fixes for getrandom fork handling
Careful updates of grnd_alloc.len are required to ensure that
after fork, grnd_alloc.states does not contain entries that
are also encountered by __getrandom_reset_state in TCBs.
For the same reason, it is necessary to overwrite the TCB state
pointer with NULL before updating grnd_alloc.states in
__getrandom_vdso_release.

Before this change, different TCBs could share the same getrandom
state after multi-threaded fork.  This would be a critical security
bug (predictable randomness) if not caught during development.

The additional check in stdlib/tst-arc4random-thread makes it more
likely that the test fails due to the bugs mentioned above.

Both __getrandom_reset_state and __getrandom_vdso_release could
put reserved NULL pointers into the states array.  This is also
fixed with this commit.  After these changes, no null pointers were
observed in the states array during testing.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-01-16 19:58:09 +01:00
..
aarch64 aarch64: Use 64-bit variable to access the special registers 2025-01-13 10:17:38 -03:00
alpha math: update alpha ulps 2025-01-05 20:02:53 +01:00
arc arc: Update libm test ulps 2025-01-15 11:41:30 +00:00
arm Rename have-mtls-descriptor to have-test-mtls-descriptor 2025-01-04 04:51:21 +08:00
csky Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
generic Add generic 'extra TLS' 2025-01-10 20:19:28 +00:00
gnu Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
hppa Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
htl htl: move pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling into libc. 2025-01-02 01:20:21 +01:00
hurd Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
i386 nptl: Introduce <rseq-access.h> for RSEQ_* accessors 2025-01-10 20:20:17 +00:00
ieee754 math: Fix acosf when building with gcc <= 11 2025-01-09 12:53:58 -03:00
loongarch Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
m68k Add missing include guards to <dl-tls.h> 2025-01-10 19:02:47 +01:00
mach mach: Fix fallthrough warning 2025-01-14 00:11:35 +01:00
microblaze Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
mips Add missing include guards to <dl-tls.h> 2025-01-10 19:02:47 +01:00
nptl nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
or1k Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
posix Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
powerpc Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
pthread Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
riscv Add missing include guards to <dl-tls.h> 2025-01-10 19:02:47 +01:00
s390 Add missing include guards to <dl-tls.h> 2025-01-10 19:02:47 +01:00
sh elf: Introduce generic <dl-tls.h> 2025-01-02 13:45:27 +01:00
sparc Move <thread_pointer.h> to kernel-independent sysdeps directories 2025-01-09 19:30:16 +01:00
unix Linux: Fixes for getrandom fork handling 2025-01-16 19:58:09 +01:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
x86 x86: Add missing #include <features.h> to <thread_pointer.h> 2025-01-09 19:30:41 +01:00
x86_64 x86-64: Cast __rseq_offset to long long int [BZ #32543] 2025-01-12 07:08:27 +08:00