Repository navigation
linux: mount points hold across hosts that share a home - #753
Draft
ronleizrowice-ant wants to merge 1 commit into
Draft
ronleizrowice-ant wants to merge 1 commit into
ronleizrowice-ant wants to merge 1 commit into
Conversation
ronleizrowice-ant
force-pushed
the
claude/project-thread-gnn6ik
branch
3 times, most recently
from
October 20, 2026 11:44
eeabb37 to
0ca44a4
Compare
ronleizrowice-ant
force-pushed
the
claude/project-thread-gnn6ik
branch
2 times, most recently
from
October 20, 2026 20:08
0f3f3af to
9215306
Compare
The processes of one host protect each other's mount points through manifests in /var/tmp. Hosts that mount one home (an NFS home on the nodes of a cluster) saw nothing of each other: a clean-up on one unlinked a mount point under a sandbox on another, and what a killed job left was swept only from its own node. Where the user's home is on a file system other kernels reach, a wrap names the mount points on such a file system in a second manifest, in <home>/.srt-mount-points. There a manifest of another boot is live by its age, ten minutes, and its writer sets its time every minute. Clean-ups that may remove what other hosts reach go on record there too. README.md, "Hosts that share a home", has the rules and the known limits. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEZ8LUnnuZdEgiFocuvVDm Co-authored-by: ronleizrowice <ronleizrowice@anthropic.com>
ronleizrowice-ant
force-pushed
the
claude/project-thread-gnn6ik
branch
from
October 20, 2026 23:13
9215306 to
9af925c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human: @ronleizrowice-ant
Requested by Ron · project thread
On top of #584. To be retargeted to
mainonce that has landed. The two should ship in one release: this adds a field and a directory to what #584 writes.One commit, on top of #584's head. The base is #584's branch, so what is shown here is this PR's own. Once #584 has landed, the commit is rebased onto
mainand the base set tomain.On Linux an absent
denyWritepath is blocked by an empty file or directory (a "mount point") that bubblewrap makes on the host. With #584 the processes of one host protect each other's, through manifests in/var/tmp. Hosts that mount one home (an NFS home on the nodes of a cluster) still see nothing of each other:bwrap: Can't find source path;Now a mount point on a shared file system goes only when no sandbox on any host relies on it, and what a killed job left there goes with the next clean-up on its own host at once, and on any host after ten minutes.
What changes
<home>/.srt-mount-points. The manifest where it always was still names all of it, so a process of the same host that does not see the home reads what it did before. The one in the home names nothing but what other hosts reach, so whoever reads it can collect it whole. A command that has both binds both before anything else and puts itself on the record of each; a claim on either refuses it its start. The directory is made, bound read-only and pinned by every wrap that restricts writes, like the other places. It is a place for nothing else, and on a host whose home is its own nothing is read or written there. Such a host still keeps the directory out of its sandboxes' reach, because to the clients of a file server the disk it exports is a network home: it is bound and pinned wherever it is there, and made first where the command could make it.keptYoung); one that does not say so keeps linux: keep the mount point manifests where the user id says, first under /var/tmp #615's seven days.<id>.finishedname is what keeps two hosts from each leaving a path to the other./var/tmpthat diskless nodes share).ESTALEon a manifest is "gone", and the reading starts over; on a record it vouches, like any record that cannot be read. A manifest that has gone from its name between the listing and the look at its age has the clean-up judge afresh. A home over its quota says so only as the bytes are flushed, so they are, explicitly (Bun passes on neither whatclosesays nor what theflushoption finds); the manifest in the host's own place is then all there is. Where the home takes no record of a clean-up, only what other hosts reach stays. Where it cannot be written from a host at all (mounted read-only there), that host reads what the others keep and spares it, and removes as it did before. While it cannot be told whether there is a network home (an error of the moment fromstatfs, twice, or no answer from the user database), or whether one of the manifest directories is there (this now goes for the host's own places too), no command that restricts writes is handed out and nothing is removed.os.userInfo()with$HOME, so there it is/etc/passwdand thengetent, at its usual places. Only that there is a network home is remembered for good; "no such user" is asked again after a minute, no answer at all after ten seconds.publishMountPointManifestreturns a list;discardMountPointManifeststakes one.Who sees a difference
Linux, and only where the home is on a network file system: a directory
.srt-mount-pointsin it, and a wrapped string with two records and two manifest binds when it names a mount point on a shared file system. On any other host there are two visible changes. Where a command may write the home itself, an empty.srt-mount-pointsis made in it and bound read-only. And for a manifest directory on a local kind of file system that is not on the list, what an earlier boot left there waits ten minutes instead of seven days.Known limits (README, "Hosts that share a home")
Clocks have to agree, the file server's too (ten minutes for sandboxes, a minute for clean-ups). A process that does not return to its event loop for ten minutes while its sandbox runs, or that has exited and left it running, is taken for gone by other hosts. It goes by the home: hosts that share a project and not the home do not see each other. Paths have to be spelled alike.
noctodefeats the fresh look. A process killed half way through a clean-up holds up other hosts' wraps for a minute. Virtual machines restored from one memory snapshot share a boot id. While the home gives errors, wraps that restrict writes are refused. A host that cannot write the home tells the others nothing. A host on an earlier release, or not on Linux, does not keep its sandboxes out of the directory. A host that exports a project from its own disk is not covered for that project.Testing
test/sandbox/mount-point-hosts.test.ts, 107 cases, also in the bubblewrap 0.4.1 step. Most stand a network file system in bystatfs; six run two hosts for real but for the network, as processes with their own places and boot id over one shared directory.mainhas on the same machine, which need outbound network./var/tmp,/tmp,/etc/passwdand boot id, over one directory that a preloaded shim reports as NFS. Six hosts, two processes each, sixty commands each, every command trying six denied writes:Claude session #01SEZ8LU
Generated by Claude Code