Repository navigation
feat(signal,syscall): implement SA_RESTART, sigaltstack, RT signal syscalls, and queued RT siginfo (N2.6a, #66) - #145
Merged
Conversation
…scalls, and queued RT siginfo (N2.6a, #66)
YUZHEthefool
force-pushed
the
feat/n2-6-signals-and-timers
branch
from
November 28, 2026 04:48
3d56f12 to
7644f41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Advances #66 (N2.6 — Signals & Timers) with N2.6a (Signals):
rt_sigpending(127),rt_sigtimedwait(128),rt_sigqueueinfo(129),rt_sigsuspend(130),sigaltstack(131), andrt_tgsigqueueinfo(297)inkernel/seccomp/syscall_table.rsand wired exhaustiveDispatchedSyscallarms inkernel/kernel_core/syscall/mod.rs.#[repr(C)] StackT(stack_t) inkernel/kernel_core/syscall/abi.rsand pinned it inscripts/tools/abi_layout_oracle.py(Leg A/B/C vs native x86_64<signal.h>).siginfo_tdelivery:SigInfo(full 128-byte Linux x86_64siginfo_twire layout:si_signo,si_errno,si_code,si_pid,si_uid,si_value), bounded allocation-free FIFORtSigQueue(MAX_QUEUED_RT_SIGNALS = 32per task and per thread group, returningEAGAINon overflow forrt_sigqueueinfo/rt_tgsigqueueinfo), andrt_sigqueueinfo/rt_tgsigqueueinfoanti-spoofing enforcement (si_code >= 0 || si_code == SI_TKILLrejected across processes withEPERM).32..=64) until drained FIFO while coalescing standard signals (1..=31).siginfo_t,uc_stack, anduc_sigmaskviaassemble_sigframe_fullon both syscall-return and IRQ-return delivery paths without disturbing SROP fixed-offset invariants.sigaltstack+SA_ONSTACK):SigAltStack(inherited onfork, disabled onclone(CLONE_VM)andexecve),sys_sigaltstack(EPERMwhen executing on the altstack,ENOMEMwhen< MINSIGSTKSZ,EINVALon unknown flags or invalid address ranges), andSigframeStack::AltStackhandling in both syscall-return and IRQ-return signal delivery.SA_RESTART,rt_sigpending,rt_sigsuspend,rt_sigtimedwait:signal(7)SA_RESTARTsyscall restart (rewindsRIP -= 2and saves original syscall number inRAXinside the sigframe for restartable blocking syscalls returningEINTR; never restartsnanosleep/poll/ppoll/select/pselect6/rt_sigsuspend/rt_sigtimedwait/connector timedfutex).rt_sigpending,rt_sigsuspend(reusingpoll_restore_blockedso the temporary mask applies during handler delivery andrt_sigreturnrestores the original mask), andrt_sigtimedwait(synchronously dequeuing pending signals even when blocked, writing 128-bytesiginfo_t, honoring timeouts andEINTR).Verification
cargo fmt --all && make fmt-check— PASSmake abi-check— PASS (13 structs, 115 values, 17 tripwires, C-leg: run)make lint— PASSbash scripts/tools/hosted_subcrate_tests.sh— PASS (822 unit tests including 6 new N2.6a unit tests inkernel_core;kernel-core227/227,seccomp20/20,lsm-hook-census5/5)make clippy && make build— PASSZERO_OS_STRICT_TESTS=1 bash scripts/gates/boot/boot_check.sh— STRICT PASS (50/50)ZERO_OS_STRICT_TESTS=1 SMP_CORES=4 bash scripts/gates/boot/kernel_test.sh— STRICT PASS (50/50)make test-ring3-mm— PASSPYTHONPATH=scripts/gates/qemu python3 -m unittest scripts/tests/qemu_run_test.py scripts/tests/qemu_trace_test.py— PASS (34/34)Part of #66