Skip to content

sandbox: fail loudly when seccomp_unotify is requested but unusable - #285

Merged
robertswiecki merged 1 commit into
google:masterfrom
h1-mrz:fail-loud-seccomp-unotify
Aug 26, 2026
Merged

sandbox: fail loudly when seccomp_unotify is requested but unusable#285
robertswiecki merged 1 commit into
google:masterfrom
h1-mrz:fail-loud-seccomp-unotify

Conversation

@h1-mrz

@h1-mrz h1-mrz commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

applyPolicy() installed the seccomp-unotify listener only when pipefd != -1. In modes that pass pipefd == -1 (e.g. MODE_STANDALONE_EXECVE) the install was silently skipped, and prepareAndCommit() then returned early because the classic seccomp filter is empty -- so a sandboxee for which seccomp_unotify was explicitly requested ran with NO seccomp policy at all, with no error emitted.

Refuse to continue instead of silently dropping the requested policy: if seccomp_unotify is set but there is no supervisor to receive the notification fd (pipefd == -1), log an error and fail.

Verified: nsjail -Me --seccomp_unotify --seccomp_string 'DEFAULT ALLOW' -- ... now aborts with a clear error instead of launching the process unfiltered.

applyPolicy() installed the seccomp-unotify listener only when pipefd != -1.
In modes that pass pipefd == -1 (e.g. MODE_STANDALONE_EXECVE) the install was
silently skipped, and prepareAndCommit() then returned early because the classic
seccomp filter is empty -- so a sandboxee for which seccomp_unotify was
explicitly requested ran with NO seccomp policy at all, with no error emitted.

Refuse to continue instead of silently dropping the requested policy: if
seccomp_unotify is set but there is no supervisor to receive the notification fd
(pipefd == -1), log an error and fail.

Verified: `nsjail -Me --seccomp_unotify --seccomp_string 'DEFAULT ALLOW' -- ...`
now aborts with a clear error instead of launching the process unfiltered.
@robertswiecki

Copy link
Copy Markdown
Collaborator

Thank you!

@robertswiecki
robertswiecki merged commit 16970c3 into google:master Aug 26, 2026
6 checks passed
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