libkernel: sigprocmask and sigsuspend keep SIGKILL and SIGSTOP in the blocked mask #8405
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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:38Z.
Repro
sigprocmask(SIG_BLOCK, &set, NULL)withset= {SIGKILL, SIGSTOP}, thensigprocmask(SIG_BLOCK, NULL, &old):oldcontains bits 9 and 17.SIG_SETMASKandpthread_sigmaskbehave the same; so does the mask installed bysigsuspend(a handler that reads the mask during the suspend sees both bits).Expected (FreeBSD 11.4
kern_sigprocmask, sys/kern/kern_sig.c:1056 and :1067): SIGKILL and SIGSTOP are removed from the set forSIG_BLOCKandSIG_SETMASK(SIG_CANTMASK);sigsuspendgoes through the same call (kern_sig.c:1534). They can never be blocked.Actual:
_sigprocmask_nid_postfixandsigsuspend_nid_postfix(libkernelSystem/src/Signals.cpp) store the set as given.Test:
core/libs/tests/GuestSignals.cpp(new cases;guest_signalsexits with 0xc0000409 before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/sigprocmask-never-block-kill-stop
AI-assisted (Claude Code).