fix(libkernel): never block SIGKILL and SIGSTOP in sigprocmask and sigsuspend #8407
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8407"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T12:27:47Z.
What
sigprocmask(SIG_BLOCK / SIG_SETMASK),pthread_sigmask(which calls it) and the masksigsuspendinstalls kept SIGKILL (9) and SIGSTOP (17) in the blocked mask. FreeBSD 11.4 removes them (SIG_CANTMASK, sys/kern/kern_sig.c:1056 forSIG_BLOCK, :1067 forSIG_SETMASK;kern_sigsuspendsets its mask throughkern_sigprocmask(SIG_SETMASK), :1534). The same two bits are now dropped from the word that the three paths store;SIG_UNBLOCKis unchanged.Fixes #8405
Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on upstream/main
d50ec76da0+ this commit:guest_signals:Exit code 0xc0000409withSystem/src/Signals.cpptaken back to main (new test lines kept), passes with the change (3 of 3 runs). New cases:SIG_BLOCKandSIG_SETMASKwith {SIGKILL, SIGSTOP, one other signal} read back as the other signal only (also viapthread_sigmask), and a handler run duringsigsuspendsees a mask without the two bits.guest_sigtimedwait,guest_itimer,guest_itimer_pending_default,guest_kill,guest_signal_sets,guest_sigaltstack,guest_getitimerpass.python tools/check_conventions.py --base upstream/main: passes.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T12:39:55Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/System/src/Signals.cppcore/libs/tests/GuestSignals.cppcore/libs/tests/GuestSignals.cppcore/libs/prx/libkernel/System/src/Signals.cppImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T18:09:21Z.
Checked the three paths against FreeBSD
kern_sigprocmask(SIG_CANTMASKforSIG_BLOCK/SIG_SETMASK,kern_sigsuspendviaSIG_SETMASK),SIG_UNBLOCKuntouched, and the newguest_signalscases only pass with the mask change; merged.