sandbox: allow restrictive nested seccomp filters without BPF JIT - #43
Open
zbarsky-openai wants to merge 1 commit into
Open
zbarsky-openai wants to merge 1 commit into
zbarsky-openai wants to merge 1 commit into
Conversation
Sandboxed programs that install their own restrictive seccomp policy currently fail inside actiond even though the worker already sets `no_new_privs`: ```text NoNewPrivs: 1 Seccomp: 2 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, ...): EPERM ``` Permit both supported nested-filter entry points (`seccomp(SECCOMP_SET_MODE_FILTER)` and `prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER)`). Disable the ARM64 kernel's BPF JIT first so these additional restrictive filters cannot expose a classic-BPF JIT surface; the x86_64 kernel already has its JIT disabled. Keep the existing denials for `bpf()`, `io_uring_setup`, `AF_VSOCK`, and socket BPF attachment. Add focused policy coverage and an end-to-end action-tool assertion that installs an additional filter after verifying the original restrictions. Validation: - Resolved both ARM64 and x86_64 Linux configurations with the actual kernel Kconfig parser: `CONFIG_SECCOMP_FILTER=y`, `CONFIG_BPF_JIT` unset. - Rebuilt the ARM64 kernel through actiond: 3,601 actions, 962 actually executed remotely (`3d5ca79e-06b2-4409-ae92-cfcefef3551f`). - Rebuilt the ARM64 guest initramfs and booted the real macOS-hosted VM without adding packages or replacing its existing CAS. - A freshly executed guest probe changed nested-filter installation from `EPERM` to success (`ba4a5aae-c440-4247-9fa1-3f802dba9b23`). - Five seccomp policy checks and five sandbox-tool checks passed inside the new VM, including the retained BPF, socket, io_uring, and audit-architecture restrictions (`47cc7191-684d-4c5d-b17a-31ee7c44088c`). - `//src:unit_tests` and `//tools:e2e_action_tool_tests` both executed and passed with test caching disabled (`ae8fe693-bbc5-4c24-9d38-5a425f5358d0`).
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.
Sandboxed programs that install their own restrictive seccomp policy currently fail
inside actiond even though the worker already sets
no_new_privs:Permit both supported nested-filter entry points (
seccomp(SECCOMP_SET_MODE_FILTER)and
prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER)). Disable the ARM64 kernel's BPFJIT first so these additional restrictive filters cannot expose a classic-BPF JIT
surface; the x86_64 kernel already has its JIT disabled. Keep the existing
denials for
bpf(),io_uring_setup,AF_VSOCK, and socket BPF attachment.Add focused policy coverage and an end-to-end action-tool assertion that installs
an additional filter after verifying the original restrictions.
Validation:
Kconfig parser:
CONFIG_SECCOMP_FILTER=y,CONFIG_BPF_JITunset.remotely (
3d5ca79e-06b2-4409-ae92-cfcefef3551f).adding packages or replacing its existing CAS.
EPERMto success (
ba4a5aae-c440-4247-9fa1-3f802dba9b23).VM, including the retained BPF, socket, io_uring, and audit-architecture
restrictions (
47cc7191-684d-4c5d-b17a-31ee7c44088c).//src:unit_testsand//tools:e2e_action_tool_testsboth executed and passedwith test caching disabled (
ae8fe693-bbc5-4c24-9d38-5a425f5358d0).