Skip to content

linux: bind a deny path that another sandbox makes while the wrap is looking - #618

Merged
ronleizrowice-ant merged 1 commit into
mainfrom
fix/linux-deny-path-made-meanwhile
Sep 28, 2026
Merged

ronleizrowice-ant merged 1 commit into
mainfrom
fix/linux-deny-path-made-meanwhile

Conversation

@ronleizrowice-ant

Copy link
Copy Markdown
Collaborator

On Linux an absent denyWrite path is blocked by an empty file ("mount point") that bubblewrap makes on the host. While building the binds, the wrap asks whether the path exists, and then whether any existing component of it is a file, because nothing can be created beneath a file (a worktree's .git file, so .git/hooks needs no deny).

That second question included the path itself. Two processes wrapping in one project deny the same absent paths (the dotfiles of the working directory), so one's bubblewrap can make its empty file there between the two questions. The path then counted as lying beneath a file and got no bind at all, for the whole command.

What changes

One line: the second question is asked of what lies above the path (path.dirname). A path that has become a file meanwhile is bound over with /dev/null, like any other.

Who sees a difference

Nobody, except in that race. A path beneath a real file is still left alone.

Testing

New test/sandbox/deny-path-made-meanwhile.test.ts: the file is made between the two looks (a spy on existsSync), and the wrap must still bind over it; it fails without the change. The worktree case is pinned beside it. Independent of every other open PR; it touches a line that #584 also rewrites around, so whichever lands second keeps path.dirname.

…looking

An absent deny path is blocked by a mount point that bubblewrap makes
on the host. The wrap looks whether the path exists and then whether a
component of it is a file, since nothing can be created beneath a file
(a worktree's `.git`). That second look included the path itself. Two
processes wrapping in one project deny the same absent paths, so one's
bubblewrap can make its empty file there between the two looks; the
path then counted as lying beneath a file and got no bind at all, for
the whole command.

The second look now asks about what lies above the path.
@ronleizrowice-ant
ronleizrowice-ant merged commit 3ed9739 into main Sep 28, 2026
8 checks passed
@ronleizrowice-ant
ronleizrowice-ant deleted the fix/linux-deny-path-made-meanwhile branch September 28, 2026 19:10
@ronleizrowice-ant ronleizrowice-ant mentioned this pull request Sep 29, 2026
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