Skip to content

Linux bwrap fails when protected symlinked carveout points outside writable roots (No such file or directory) #17079

Closed

Description

@rebroad

Summary

Linux sandbox startup can fail when a protected read-only carveout path (for example .git) is a symlink under a writable root and that symlink points to an absolute target outside writable roots.

bwrap is currently invoked with a mask like:

--ro-bind /dev/null /var/tmp/src-builds/codex.other/.git

In this scenario, preflight can fail before any command/tool runs with:

bwrap: Can't create file at /var/tmp/src-builds/codex.other/.git: No such file or directory

Repro shape

  • workspace-write sandbox with writable root that canonicalizes to /var/tmp/src-builds/codex.other
  • protected carveouts include .../.git
  • .../.git is a symlink to an absolute path outside writable roots

Example:

  • /var/tmp/src-builds/codex.other/.git -> /home/rebroad/src/codex/.git

Observed behavior

  • non-escalated commands (including apply_patch) fail at sandbox preflight
  • error appears before command execution

Expected behavior

Sandbox should start successfully. It should not hard-fail when masking a symlinked protected path in this layout.

Related issues

This appears to be a related but distinct failure mode (No such file or directory) triggered by symlink target layout and mount semantics.

Activity

  1. changed the title [-]Linux bwrap fails when protected symlinked carveout points outside writable roots ()[/-] [+]Linux bwrap fails when protected symlinked carveout points outside writable roots (No such file or directory)[/+] on Apr 8, 2026
  2. added
    bug
    CLI
    sandbox
    on Apr 8, 2026
  3. rebroad commented on Apr 8, 2026

    @rebroad
    Author

    Clarifying why this may or may not be distinct from #15725 / #16161:

    That said, this could still be the same underlying class of bug (file-style /dev/null masking on symlinked carveouts) with a different filesystem/layout-dependent error message.

    If maintainers believe the existing fix/work in #15725 (or prior fixes around #16161) fully covers this case, this issue can be closed as duplicate. I’m keeping this open only to preserve the No such file or directory variant and exact mount argv seen in logs.

  4. removed
    CLI
    on Apr 8, 2026
  5. viyatb-oai commented on Apr 8, 2026

    @viyatb-oai
    Contributor

    being fixed in #15981

  6. added a commit that references this issue on Apr 11, 2026
    b114781
  7. added a commit that references this issue on Jun 27, 2026
    9a87319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions