Skip to content

feat(signals): added signal frame delivery mechanism - #166

Merged
FlareCoding merged 2 commits into
masterfrom
pr/signal-delivery-mechanism
Aug 12, 2026
Merged

feat(signals): added signal frame delivery mechanism#166
FlareCoding merged 2 commits into
masterfrom
pr/signal-delivery-mechanism

Conversation

@FlareCoding

Copy link
Copy Markdown
Owner

Summary

  • Running a user signal handler requires the interrupted register and FP state to be saved onto the user stack and restored on rt_sigreturn; this adds the per-arch frame builders, the restore path, and the selection of which pending handled signal to deliver.
  • The restore path sanitizes user-controlled state: x86_64 masks RFLAGS and rejects a non-canonical return RIP (which sysret would fault on in Ring 0), aarch64 forces PSTATE back to EL0, and a corrupt FP record is rejected as SIGSEGV on both.
  • Unused until the return-to-user hook activates it, keeping the delivery mechanism reviewable in isolation.

Made with Cursor

Running a user handler needs the interrupted register and FP state saved
onto the user stack and restored on rt_sigreturn. The per-arch frame
builders, sanitizing restore path, and pending-handler selection provide
that for the return-to-user hook.

Co-authored-by: Cursor <cursoragent@cursor.com>
cursor[bot]

This comment was marked as resolved.

FXRSTOR and SYSRET both fault with kernel privilege on user-controlled
values, and the trap path panics for a supervisor fault instead of killing
the task. Masking MXCSR and rejecting an out-of-range handler close both.

Co-authored-by: Cursor <cursoragent@cursor.com>
@FlareCoding
FlareCoding merged commit b3a648f into master Aug 12, 2026
19 checks passed
@FlareCoding
FlareCoding deleted the pr/signal-delivery-mechanism branch August 12, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant