Skip to content

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

Open
h1-mrz wants to merge 1 commit into
google:masterfrom
h1-mrz:fail-loud-seccomp-unotify
Open

sandbox: fail loudly when seccomp_unotify is requested but unusable#285
h1-mrz wants to merge 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

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.
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.

1 participant