libkernel: sigaction accepts flag bits that FreeBSD 11.4 rejects with EINVAL #8409
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:52Z.
Repro
sigaction(SIGUSR1 /* 30 */, &act, NULL)withact.sa_handler= a function andact.sa_flags=0x80(or0x100,0x8000,0x40 | 0x80): returns 0 and stores the disposition.Expected (FreeBSD 11.4
kern_sigaction, sys/kern/kern_sig.c:691-695): EINVAL when the handler is not SIG_DFL or SIG_IGN andsa_flagshas a bit outside SA_ONSTACK (0x1), SA_RESTART (0x2), SA_RESETHAND (0x4), SA_NOCLDSTOP (0x8), SA_NODEFER (0x10), SA_NOCLDWAIT (0x20), SA_SIGINFO (0x40). With SIG_DFL or SIG_IGN the flags are not checked.Actual:
sigaction_nid_postfix(libkernelSystem/src/Signals.cpp) only checks the signal number and the SIGKILL/SIGSTOP rule.Test:
core/libs/tests/GuestSignals.cpp(new cases;guest_signalsexits with 0xc0000409 before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/sigaction-reject-undefined-flags
AI-assisted (Claude Code).