Skip to content

Clear setgid when securing Windows VM mounts - #9504

Closed
jmwall wants to merge 1 commit into
omacom:quattrofrom
jmwall:fix/windows-vm-clear-setgid
Closed

jmwall wants to merge 1 commit into
omacom:quattrofrom
jmwall:fix/windows-vm-clear-setgid

Conversation

@jmwall

@jmwall jmwall commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fix protected-mount setup for existing Windows VM shared directories carrying the setgid bit.

GNU chmod 0700 preserves setgid on directories. When the shared directory is mode 2700, the launcher therefore reads it back as 2700, rejects it because it is not exactly 700, and aborts before starting the VM or FreeRDP.

Use chmod =0700 during both user preflight and privileged mount preparation so inherited special bits are explicitly cleared.

Add regression coverage for setgid shared directories in the compose and privileged mount-boundary suites.

Tests:

  • bash test/shell.d/windows-vm-compose-test.sh
  • bash test/shell.d/windows-vm-mount-boundary-test.sh
  • OMARCHY_PKGS_PATH=/tmp/omarchy-pkgs-codex ./test/all

GNU chmod preserves setgid on directories when given 0700. Explicitly clear inherited special bits so existing shared directories can pass the protected-mount migration.
@bjarneo

bjarneo commented Sep 20, 2026

Copy link
Copy Markdown
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.

@bjarneo bjarneo closed this Sep 20, 2026
@jmwall
jmwall deleted the fix/windows-vm-clear-setgid branch September 23, 2026 15:53
@omarchybot

Copy link
Copy Markdown
Collaborator

Update: #12323 has merged into quattro. The setgid permission rejection is now fixed in both source-directory hardening paths, with an explicit mode diagnostic. This does not claim that runtime share privacy or every desktop failure notification is fixed.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants