]> sourceware.org Git - glibc.git/commit
Block all signals on timer_create thread (BZ#10815)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 9 Dec 2019 17:33:33 +0000 (14:33 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 19 Feb 2020 16:46:31 +0000 (13:46 -0300)
commit27d83441a2f900059d0421339d0e8c27220ffa36
tree22b8a2d04bfc965462d96a99b32da18fc17eb2b5
parent8d42bf859a289944749d9f978c076cd318119867
Block all signals on timer_create thread (BZ#10815)

The behavior of the signal mask on threads created by timer_create
for SIGEV_THREAD timers are implementation-defined and glibc explicit
unblocks all signals before calling the user-defined function.

This behavior, although not incorrect standard-wise, opens a race if a
program using a blocked rt-signal plus sigwaitinfo (and without an
installed signal handler for the rt-signal) receives a signal while
executing the used-defined function for SIGEV_THREAD.

A better alternative discussed in bug report is to rather block all
signals (besides the internal ones not available to application
usage).

This patch fixes this issue by only unblocking SIGSETXID (used on
set*uid function) and SIGCANCEL (used for thread cancellation).

Checked on x86_64-linux-gnu and i686-linux-gnu.
nptl/Makefile
nptl/tst-cancel28.c [new file with mode: 0644]
rt/Makefile
rt/tst-timer-sigmask.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/internal-signals.h
sysdeps/unix/sysv/linux/timer_routines.c
This page took 0.042413 seconds and 5 git commands to generate.