Repository navigation
seccomp: check every handler against the filter the child installs - #366
Open
congwang-mk wants to merge 1 commit into
Open
congwang-mk wants to merge 1 commit into
congwang-mk wants to merge 1 commit into
Conversation
The BPF notif list and the dispatch table were built from separate syscall lists in separate processes, so a handler registered for a syscall the filter allows would never run and nothing said so. Two such cases existed: the shmget accounting handler when SysV IPC is denied, and the sysinfo handler when the policy denies sysinfo. The parent now builds one FilterSpec before fork. The child installs it and the supervisor refuses to start if any handler sits on a syscall that spec does not notify. The lists with a single handler (memory accounting, exec, destination, timer and open-family syscalls) are defined once in seccomp/filter.rs and iterated by both sides. Signed-off-by: Cong Wang <cwang@multikernel.io>
This branch has not been deployed
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.
Stacked on #365; the base is
seccomp-filter-spec, so this shows only the one commit on top of it.Problem
The BPF notif list and the dispatch table were built from separate syscall lists in separate processes. A handler registered for a syscall the filter allows never runs, and nothing reported it. Two such cases existed:
Change
FilterSpecbefore fork. The child installs it and the same value goes to the supervisor.ChildSpawnArgscarriesfilterin place offeaturesandextra_syscalls.runlike any other startup failure, in release builds too.sysv_ipc_allowedon both sides, and the sysinfo handler is registered only when sysinfo is notified.seccomp/filter.rsand iterated by both the filter andbuild_dispatch_table.notif::supervisorbecomespub(crate), since it takes the crate-privateFilterSpec. Nothing outside the crate called it.Not covered
Tests
main, so it was dispatched manually on this branch: all 25 jobs pass (run).🤖 Generated with Claude Code