Skip to content

fix(linux-sandbox): avoid panic on bwrap build failures#21127

Merged
evawong-oai merged 5 commits intomainfrom
codex/viyatb/fix-bwrap-build-panic
May 5, 2026
Merged

fix(linux-sandbox): avoid panic on bwrap build failures#21127
evawong-oai merged 5 commits intomainfrom
codex/viyatb/fix-bwrap-build-panic

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented May 5, 2026

Summary

  • Propagate Linux bubblewrap argument-construction failures instead of panicking in the helper
  • Keep mutable-symlink carveouts fail-closed while reporting them as ordinary sandbox build failures
  • Add regression coverage for a protected .codex symlink inside a writable workspace root

Root cause

Linux bubblewrap intentionally rejects read-only carveouts that cross a symlink the sandboxed process can still rewrite. That is the correct security behavior for protected metadata paths such as .codex.

The bug was one layer higher: linux_run_main treated the expected build failure as impossible and panicked while constructing the bubblewrap argv. For issue #20716, that turned a normal fail-closed sandbox outcome into a noisy panic in the transcript.

User impact

Users with a project-local .codex symlink inside a writable workspace still get the conservative sandbox decision, but they no longer see a Rust panic for that condition. The helper now exits with the concise sandbox-build error so the normal denial / escalation path can handle it.

Fixes #20716

@viyatb-oai viyatb-oai marked this pull request as ready for review May 5, 2026 02:55
Copy link
Copy Markdown
Contributor

@evawong-oai evawong-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff and CI. This is scoped to the Linux sandbox panic fix and has regression coverage.

@evawong-oai evawong-oai merged commit 8b95d54 into main May 5, 2026
37 of 38 checks passed
@evawong-oai evawong-oai deleted the codex/viyatb/fix-bwrap-build-panic branch May 5, 2026 20:34
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux sandbox panics when project .codex is a symlink into writable workspace.

2 participants