Skip to content

Add seccomp argv0 mode for multicall-binary invocation#203

Merged
dylan-conway merged 1 commit intomainfrom
dylan/seccomp-argv0-mode
Apr 2, 2026
Merged

Add seccomp argv0 mode for multicall-binary invocation#203
dylan-conway merged 1 commit intomainfrom
dylan/seccomp-argv0-mode

Conversation

@dylan-conway
Copy link
Copy Markdown
Collaborator

When the caller has apply-seccomp compiled into its own executable (busybox-style multicall dispatch), there is no standalone binary on disk to resolve. seccompConfig.argv0 lets the caller supply the dispatch name and a verbatim applyPath (e.g. an inherited-fd path like /proc/self/fd/N); the wrapped invocation becomes

ARGV0=<argv0> <applyPath> <shell> -c <cmd>

and the on-disk getApplySeccompBinaryPath lookup is skipped.

Changes

  • sandbox-config: optional argv0 string on SeccompConfigSchema (parallel to ripgrep.argv0)
  • linux-sandbox-utils: resolveApplySeccompPrefix helper returns a shell-ready prefix for both modes; non-argv0 output is byte-identical to before. Dependency checks short-circuit the disk lookup when argv0 is set. Inline {applyPath?; argv0?} shapes replaced with the SeccompConfig type.
  • sandbox-manager: use SeccompConfig type
  • tests: argv0 dependency-check short-circuit, wrapped-command prefix format, shell-quoting of hostile inputs, argv0-without-applyPath error

When the caller has apply-seccomp compiled into its own executable
(busybox-style multicall dispatch), there is no standalone binary on
disk to resolve. seccompConfig.argv0 lets the caller supply the dispatch
name and a verbatim applyPath (e.g. an inherited-fd path like
/proc/self/fd/N); the wrapped invocation becomes

    ARGV0=<argv0> <applyPath> <shell> -c <cmd>

and the on-disk getApplySeccompBinaryPath lookup is skipped.

- sandbox-config: optional argv0 string on SeccompConfigSchema (parallel
  to ripgrep.argv0)
- linux-sandbox-utils: resolveApplySeccompPrefix helper returns a
  shell-ready prefix for both modes; non-argv0 output is byte-identical
  to before. Dependency checks short-circuit the disk lookup when argv0
  is set. Inline {applyPath?; argv0?} shapes replaced with the
  SeccompConfig type.
- sandbox-manager: use SeccompConfig type
- tests: argv0 dependency-check short-circuit, wrapped-command prefix
  format, shell-quoting of hostile inputs, argv0-without-applyPath error
@dylan-conway dylan-conway merged commit 2dc232b into main Apr 2, 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