Skip to content

Don't let denyWrite unmask denyRead tmpfs dirs - #305

Merged
shawnm-anthropic merged 1 commit into
mainfrom
fix/deny-write-tmpfs-dir-unmask
Jun 12, 2026
Merged

shawnm-anthropic merged 1 commit into
mainfrom
fix/deny-write-tmpfs-dir-unmask

Conversation

@poteat

@poteat poteat commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

TLDR: a folder denied for both read and write could still be read inside the linux sandbox; now it stays hidden

A directory in both deny lists under an allowed write root got its denyWrite ro-bind stacked on top of its own denyRead tmpfs, exposing the real contents read-only. We now skip denyWrite binds the tmpfs already hides, and re-apply the tmpfs when an ancestor denyWrite bind re-exposes it. The #190 and #195 orderings are preserved.

Links

Test Plan

  • Linux CI: three new mount-ordering tests in wrap-with-sandbox.test.ts

@poteat poteat changed the title fix: denyWrite bind re-exposes a denyRead tmpfs over the same dir (#190 regression, dir case of #195) fix: denyWrite unmasks denyRead tmpfs dirs Jun 12, 2026
@poteat poteat changed the title fix: denyWrite unmasks denyRead tmpfs dirs Don't let denyWrite unmask denyRead tmpfs dirs Jun 12, 2026
#190 buffers denyWrite ro-binds and emits them after the denyRead loop;
#195 masks the file-level overlap, but a directory in both deny lists
under an allowed write root gets --ro-bind <dir> <dir> stacked on top of
its own tmpfs, exposing the real contents read-only. Skip denyWrite
binds whose dest a denyRead tmpfs already hides, preserving the #190
exception for dests re-exposed by a re-bound allowed write path.

Also the inverse: a denyWrite bind over an ancestor of a denyRead dir
re-exposes it from above; re-apply the tmpfs (and its re-binds) on top.
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