Repository navigation
Conversation
Automated AI review
Verified: in the tested scope, the change clears set-ID bits on both hardening paths. The existing Windows VM tests that ran still pass, but they also pass without the fix, so a regression test would be useful. Both hardening paths now reach mode 700 from set-ID sources, and the exact
No test covers the set-ID case
Impact: nothing in the suite would catch a later change back to a numeric-only chmod. Suggested change: a section like this at the end of # dockur marks an empty /shared setgid (2777) at container start, and a numeric
# chmod keeps that bit on a directory. Both hardening steps must clear it.
reset_case
mkdir -p "$HOME/.windows" "$HOME/Windows"
chmod 2777 "$HOME/Windows"
prepare_user_mount_sources
[[ $(stat -Lc '%a' "$HOME/Windows") == 700 ]] || fail "user-side hardening kept the setgid bit"
write 4G 2 64G setgid pw UTC
chmod 2777 "$HOME/Windows"
prepare_caller_mounts || fail "privileged preflight rejected a setgid shared source"
[[ $(stat -Lc '%a' "$HOME/Windows") == 700 ]] || fail "privileged preflight kept the setgid bit"
mounts_ready || fail "re-hardened mounts were rejected"
pass "both hardening steps clear the setgid bit dockur re-applies to the shared source"On the merge-base it stops at the user-side assertion. The root-side half was checked separately: it fails on the merge-base. Linked issues: #11940 and #9630 were closed as duplicates of #9334, which is still open. Adding Related PRs: several open PRs change the same chmod lines, some with set-ID tests: #9605, #10338, #10411, #12264, #12323, #13154 and #13213. #10113 takes the opposite approach: it relaxes Wording: dockur's Optional: the new message could name Review informationTest scope: pinned head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for tracking this down. The cause you found is right, and the bug is still on Nine open pull requests fix this one bug (tracked in #9334): this one, #9605, #10113, #10338, #10411, #12264, #12323, #13154 and #13213. Only one of them should be brought to the maintainer as ready, and this isn't the one we're recommending, for two reasons:
The fix we're recommending to the maintainer is #9605. It clears the bits in one call at both mount-source sites and also at the credentials directory, which is hardened the same way at line 1061, and its test covers both the user and the root path. #9605 was opened by this bot account, so the maintainer should weigh that. #12323 has the most thorough root-path tests of the contributor pull requests and is the closest alternative. The choice is the maintainer's, and nothing has been marked ready for this bug yet. This was checked by Claude Opus 5.5, which compared all nine diffs against |
|
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 |
Fixes #11940, fixes #9630.
Numeric chmod preserves setuid/setgid on directories (man chmod), so a 2700 ~/Windows source survived the bare chmod 0700 preflight in prepare_caller_mounts and tripped the == 700 guard on every launch, with no diagnostic. The setgid bit is re-applied each session by the guest Samba share, so this recurred after every VM run.
Verified: 2700 -> 700 through the same /proc FD path; windows-vm-test and windows-vm-compose-test pass.