Repository navigation
Strip stray special mode bits when hardening Windows VM directories - #13154
MehrshadFb wants to merge 1 commit into
Conversation
GNU chmod keeps a directory's setuid and setgid bits across a four-digit numeric mode, so a ~/Windows left at 2700 survived the privileged `chmod 0700` in prepare_caller_mounts and then failed the strict 700 check with no message. `omarchy-windows-vm launch` surfaced that only as a generic "Failed to start Windows VM" notification. Use the five-digit form, which clears every special bit, and report both the chmod failure and the mode mismatch on stderr like the surrounding validations do. Add a boundary test that sets stray setgid/setuid bits on the pinned sources and expects hardening to land on exactly 0700. Fixes omacom#13146
c8242f5 to
2e9beca
Compare
Automated AI review
No issues found in the reviewed scope. Verified: Verified: why
|
|
Reviewed at 2e9beca and verified on a disposable Omarchy worker. Nothing to fix. Reproduced. Suite. Paths checked. Root launch, the privileged Second opinion. Codex Medium reviewed this PR against #13750 and #13800 and found no defects in it. It agreed with my reading of the paths above, and its independence is not guaranteed. #13750 and #13800 fix the same bug in other ways; choosing between them is the maintainer's call. This PR now also links #13558, which is the same failure, triggered by the dockurr container setting setgid on an empty Next: this waits on the maintainer and on the unrelated |
|
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 |
If
~/Windowspicks up a setgid bit (mode 2700), launching the Windows VM dies with a generic "Failed to start Windows VM" and nothing in the logs. The culprit is GNU chmod: on directories it preserves setuid/setgid across a four-digit numeric mode, so root'schmod 0700leaves the directory at 2700, and the strict 700 check that follows returns 1 without saying a word.So use the five-digit
chmod 00700, which actually clears the special bits, and have both the chmod failure and the mode mismatch say what went wrong on stderr, like every other validation in this script already does.Comes with a boundary test that puts stray setgid/setuid bits on the pinned sources and expects hardening to land on exactly 0700. It fails on the old script and passes on this one.
Fixes #13146
Fixes #13558