Repository navigation
Conversation
… launch prepare_caller_mounts() hardens ~/.windows and ~/Windows to mode 0700 before binding them in as the protected Docker anchors, using a bare numeric `chmod 0700`. GNU chmod treats an absolute numeric mode as a no-op for any setuid/setgid bit a directory already carries -- only an explicit symbolic clear (`u-s,g-s`) removes it. The dockurr/windows container marks ~/Windows setgid while it shares that directory over SMB/9p to the guest, so every launch after the first quietly failed prepare_caller_mounts's own mode check, with no diagnostic anywhere (that branch has no echo on failure) -- just the generic "Failed to start Windows VM!" notification. Verified in isolation, independent of the container: chmod 0700 on a plain directory that already carries setgid reports success (rc=0) and leaves the mode unchanged; chmod u-s,g-s -- then chmod 0700 clears it reliably. Add the symbolic clear before the existing numeric chmod, and add a regression test that reproduces the drift on the legacy shared source and confirms prepare_caller_mounts recovers it instead of failing closed. Same root cause as the following independently reported issues: omacom#11575, omacom#10321, omacom#10486, omacom#10151, omacom#10004, omacom#9943, omacom#10047, omacom#9374, omacom#10983, omacom#9567, omacom#9884, omacom#10608, omacom#10369, omacom#10256, omacom#9746, omacom#11490, omacom#11603, omacom#10114, omacom#9630, omacom#10149, omacom#10856, omacom#11262. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Automated duplication check: this pull request looks similar to #9322, which covers the same Windows VM mount set-ID hardening. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
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.
What happened
prepare_caller_mounts()hardens~/.windowsand~/Windowsto mode0700before binding them in as the protected Docker anchors, using a bare numericchmod 0700. GNUchmodtreats an absolute numeric mode as a silent no-op for any setuid/setgid bit a directory already carries — only an explicit symbolic clear (u-s,g-s) removes it.The
dockurr/windowscontainer marks~/Windowssetgid while it shares that directory over SMB/9p to the guest. So on every launch after the first,prepare_caller_mounts's own mode check silently fails (that branch has noechoon failure), surfacing only as the generic "Failed to start Windows VM!" notification with zero diagnostic anywhere — not the terminal, not the journal.Verified in isolation, independent of any container:
The fix
Add the symbolic clear (
chmod u-s,g-s) before the existing numericchmod 0700inprepare_caller_mounts(), so the remediation it already attempts actually works.Also adds a regression test to
test/shell.d/windows-vm-mount-boundary-test.shthat reproduces the setgid drift on the legacy shared source and assertsprepare_caller_mountsrecovers it instead of failing closed.One honesty note on testing: that suite simulates the root/pkexec boundary via
unshare+ mount namespaces, and in my sandboxed dev environment it fails before reaching my new assertion — but it fails identically against unmodifiedquattro, so that's a pre-existing environment limitation on my end, not something this change introduces. The core mechanism above is verified directly and reliably reproduces both the bug and the fix.Duplicate reports this addresses
This exact root cause has been independently reported many times: #11575, #10321, #10486, #10151, #10004, #9943, #10047, #9374, #10983, #9567, #9884, #10608, #10369, #10256, #9746, #11490, #11603, #10114, #9630, #10149, #10856, #11262.
🤖 Generated with Claude Code