seccomp: accept syscall group names in both --extra-deny-syscall and --extra-allow-syscall - #167
Open
congwang-mk wants to merge 1 commit into
Open
seccomp: accept syscall group names in both --extra-deny-syscall and --extra-allow-syscall#167congwang-mk wants to merge 1 commit into
congwang-mk wants to merge 1 commit into
Conversation
…--extra-allow-syscall The two flags treated group names asymmetrically and partly silently: deny accepted only individual syscall names (denying SysV IPC took four flags naming each member), while allow accepted group names but validated nothing, so a typo like "sysvipc" built a sandbox that kept the group blocked with no error. Both flags now resolve names through a shared SYSCALL_GROUPS table: deny accepts a syscall or group name and expands groups to their members, allow accepts group names only and rejects unknown ones (re-allowing arbitrary single syscalls could punch holes in the mediation boundary, io_uring being the canonical example), and allow/deny conflicts fail at build time because the BPF layout places notif JEQs before deny JEQs, so an allowed group routing a syscall to notif would silently shadow a kernel-level deny of that same syscall. Signed-off-by: Cong Wang <cwang@multikernel.io>
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.
--extra-deny-syscalland--extra-allow-syscalltreated group names asymmetrically, and the allow side failed silently:--extra-allow-syscall sysvipc) built a sandbox that silently kept the group blocked, and the existing unit test even asserted that no-op.Both flags now resolve names through a shared
SYSCALL_GROUPStable (currently justsysv_ipc):--extra-deny-syscallaccepts a syscall name or a group name; groups expand to their member syscalls inresolve_blocklist, for both the supervised and no-supervisor blocklists.--extra-allow-syscallaccepts group names only; unknown names are rejected with the known-group list in the error. Individual syscalls stay non-re-allowable on purpose: punching single-syscall holes in the default blocklist can bypass the mediation boundary (io_uring being the canonical example).Docs updated (sandbox-reference.md, python README). New unit tests cover group expansion in both blocklists, unknown-name rejection on both flags, rejection of individual syscall names on the allow side, and both conflict shapes.