Skip to content

Enable seccomp filter#805

Open
CvvT wants to merge 7 commits intomainfrom
weiteng/enable_seccomp
Open

Enable seccomp filter#805
CvvT wants to merge 7 commits intomainfrom
weiteng/enable_seccomp

Conversation

@CvvT
Copy link
Copy Markdown
Contributor

@CvvT CvvT commented Apr 24, 2026

Address #793 to enable seccomp filter for Linux userland.

In release mode, disallowed syscalls would return EINVAL directly while in debug mode, they are also logged in addition to returning EINVAL.

@CvvT CvvT marked this pull request as ready for review April 24, 2026 18:47
Comment on lines +483 to +487
// In debug builds, log violations instead of silently returning an error so that
// it won't fail silently during development (which may hard to debug) and we can
// tell there are missing seccomp rules to be added by comparing debug and release runs.
if cfg!(debug_assertions) {
SeccompAction::Log
Copy link
Copy Markdown
Member

@jaybosamiya-ms jaybosamiya-ms Apr 25, 2026

Choose a reason for hiding this comment

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

Minor suggestion: we can use SCMP_ACT_TRAP to get a SIGSYS with SYS_SECCOMP that we can use to actually log via litebox_util_log::error!(...) which might be nicer than needing to diff debug/release runs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! One minor issue: litebox_util_log::error! is not async-signal-safe, so I use raw syscall write instead.

@github-actions
Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

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