fix(libkernel): reject undefined sa_flags in sigaction with EINVAL #8411
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8411"
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:28:03Z.
What
sigactionstored any flag word. FreeBSD 11.4kern_sigaction(sys/kern/kern_sig.c:691-695) returnsEINVALfor a handler other thanSIG_DFL/SIG_IGNwhosesa_flagshas a bit outside the seven defined ones (0x7f, sys/sys/signal.h:382-391).sigaction_nid_postfixnow does the same before it touches the disposition;SIG_DFLandSIG_IGNare not checked, as in FreeBSD.A title that passes undefined bits ran before this change; the same call fails with
EINVALon a console. This is taken from the FreeBSD source and was not measured on hardware.Fixes #8409
Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on upstream/main
56b299c3a9+ 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: flags0x80,0x100,0x8000and0x40 | 0x80with a handler fail withEINVALand leave the disposition unchanged;SIG_IGNwith0x8000still succeeds.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:40:00Z.
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:11:18Z.
Checked against FreeBSD 11.4 kern_sigaction (kern_sig.c:691-695): same condition, SIG_DFL/SIG_IGN unchecked; the new cases fail without the change and the existing flag uses in guest_signals stay inside 0x7f; merged.