diff options
author | Rich Felker <dalias@aerifal.cx> | 2020-10-24 13:34:29 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2020-10-24 15:59:40 -0400 |
commit | 0b87551bdfb74ac411caa335d8ad0b89a7f139c6 (patch) | |
tree | 7e8aea0b9b9f7b18f33001184ba2e9cb4d1384f8 /src/thread/pthread_spin_unlock.c | |
parent | 99d5098a885feae3ae8c32b407350d8ca85dd178 (diff) | |
download | musl-0b87551bdfb74ac411caa335d8ad0b89a7f139c6.tar.gz musl-0b87551bdfb74ac411caa335d8ad0b89a7f139c6.tar.bz2 musl-0b87551bdfb74ac411caa335d8ad0b89a7f139c6.tar.xz musl-0b87551bdfb74ac411caa335d8ad0b89a7f139c6.zip |
lift sigaction abort locking to fix posix_spawn child deadlock
commit 25ea9f712c30c32957de493d4711ee39d0bbb024 introduced a deadlock
to the posix_spawn child whereby, if abort was called in the parent
and ended up taking the abort lock to terminate the process, the
__libc_sigaction calls in the child would wait forever to obtain a
lock that would not be released. this could be fixed by having abort
set the abort lock as the exit futex address, but it's cleaner to just
remove the SIGABRT special handling from the internal __libc_sigaction
and lift it to the public sigaction function.
nothing but the posix_spawn child calls __libc_sigaction on SIGABRT,
and since commit b7bc966522d73e1dc420b5ee6fc7a2e78099a08c the abort
lock is held at the time of __clone, which precludes the child
inheriting a kernel-level signal disposition inconsistent with the
disposition on the abstract machine. this means it's fine to inspect
and modify the disposition in the child without a lock.
Diffstat (limited to 'src/thread/pthread_spin_unlock.c')
0 files changed, 0 insertions, 0 deletions