Skip to content

ksud: Implement SIGSYS handler#3080

Closed
aviraxp wants to merge 7 commits intomainfrom
aviraxp-patch-1
Closed

ksud: Implement SIGSYS handler#3080
aviraxp wants to merge 7 commits intomainfrom
aviraxp-patch-1

Conversation

@aviraxp
Copy link
Copy Markdown
Collaborator

@aviraxp aviraxp commented Dec 20, 2025

Prevent crash if there is no root access.

Copilot AI review requested due to automatic review settings December 20, 2025 08:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a SIGSYS signal handler in ksud to gracefully handle system calls blocked by seccomp filters. When a syscall is blocked, instead of terminating, the handler catches the signal and returns -EPERM to the caller.

Key changes:

  • Added a SIGSYS signal handler function that modifies CPU context to return EPERM for blocked syscalls
  • Implemented architecture-specific register handling for aarch64 and x86_64
  • Integrated handler setup into the application initialization in the run() function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread userspace/ksud/src/cli.rs Outdated
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs Outdated
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs
Added null checks for info and ctx in sigsys_handler.
Improved signal handling by adding logging for invalid signals and updating context casting.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs
Comment thread userspace/ksud/src/cli.rs Outdated
Updated the sigsys_handler function to include a context parameter.
@Ylarod Ylarod force-pushed the main branch 4 times, most recently from f99db52 to b3d034d Compare March 27, 2026 13:38
@aviraxp aviraxp closed this Apr 2, 2026
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.

2 participants