Repository navigation
Conversation
dockur resets an empty /shared bind to mode 2777 for Samba guest access on every container start, and btrfs does not clear the setgid bit with an octal chmod (2777/2700 persist). The launch preflight demanded the exact private 0700 for both sources, so a freshly tracked Windows VM with an empty ~/Windows failed mounts_ready and fell back to pkexec, which cannot prompt in headless environments, aborting the VM start. Relax the two mode checks to require only caller-owner full rwx (accepting setgid and guest-write bits), keeping the FD-pinned identity and ownership checks strict. Add a boundary test asserting a 2777 shared source still passes the final guard while exact 0700 remains accepted.
|
Reviewed by Claude Opus 5 at high effort, with an independent second opinion from Codex at xhigh reasoning, and exercised on a disposable Omarchy VM rather than only read. The launch failure you are fixing is real and I reproduced it. The diagnosis behind the fix is off by one step, though, and the correct one leads to a change that does not require loosening the guard — so this is a report rather than a patch to your branch. The btrfs attribution is wrong, and it is load-bearingPoint 4 of the description says btrfs does not clear the setgid bit with a plain octal That matters beyond pedantry, because I ran that through your own boundary test as the harness, on a worker, against three builds of the helper with a
The middle row is the bug fixed with the mode left private. Every route back into a launch passes through What accepting the mode gives away, and to whom
The anchor is reachable. Re-running that same probe inside your new block, on a worker: Concretely, for any other local account on the machine — a second user, a service account, anything running outside the user's own uid: read every file exchanged with Windows, and plant an executable in the folder the user browses from inside the guest. The same guard covers The container does widen the mode — that part of the description checks out. The new test's last assertion does not test what it saysCodex caught this and I measured it. Line 155 does So "exact 0700 stays accepted" is really asserting that An empty mode is now a fatal bash error rather than a refusalLines 596-597 explicitly permit an empty mode with Separately, Where this leaves itNot merged, not approved, nothing pushed to your branch — the approach is a maintainer decision, not something to rewrite under you. Six open PRs now change this file: #9564, #9605, #9783, #9989, #10046 and this one. The other five all fix the hardening step so the mode ends up at What ran: your |
|
Follow-up to the review above. The head is still 5b3e934, so those findings stand unchanged. What has changed is the set of competing fixes. Of the five other open pull requests on this file at that review, #9564, #9989 and #10046 have since closed. Two remain, #9605 and #9783, and both fix the hardening step rather than the guard. They clear the setgid bit with a symbolic I compared the three again for which one should go forward. Codex at medium effort did the same comparison separately and was not told my answer. We both ranked them #9605, then #9783, then this one. This PR is ranked last for the reason given above: Since this one is not the fix we would carry forward, it was not re-run on a worker this round; the results above are from 4 September at this same head. Nothing was pushed to your branch. Which fix lands is the maintainer's decision, and this is waiting on them. |
|
Closing this alternative after #12323 merged into Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup. Omabot on behalf of DHH |
Problem
omarchy windows vm launchintermittently fails to start the Windows VM, aborting with❌ Failed to start Windows VM!.Root cause (verified on Arch/btrfs):
/run/samba.shat every start; because~/Windows(the/sharedsource) is empty, it runschmod 2777 /sharedplus the Samba configdirectory mask = 02777, so the shared source becomes mode2777.mounted_leaf_matchesandprepare_caller_mountsdemanded the exact private0700($mode == 700) for both sources.mounts_readyfalse, solaunchfell back topkexec, which cannot prompt in a headless/agent context → failure.chmod 0700(2700persists), so even the hardening step cannot reliably produce700on btrfs.Fix
Relax the two mount-mode checks to require only that the caller owns the source and retains full owner rwx, i.e. accept any mode where
(mode & 0700) == 0700(0700,2700,2777). The FD-pinned identity/ownership checks remain strict.bin/omarchy-windows-vmmounted_leaf_matches()andprepare_caller_mounts()2777shared source still passes the final guard, while exact0700remains accepted.Verification
~/Windowsat mode2777,omarchy windows vm launchproceeds throughwith_vm_lock→dc up -d(nopkexecfallback) and the container reportsWindows VM Status: RUNNING.test/shell.d/windows-vm-test.sh(3 ok) andtest/shell.d/windows-vm-compose-test.sh(22 ok) pass. The mount-boundary suite exercises the new2777-tolerance assertion on systems where nested user/mount namespace tests can run.Related issue: #10114 (fixes the reported launch failure).