Repository navigation
disk: a copied disk keeps WSL 3.0.2's user-only permissions - #120
Merged
Merged
Conversation
WSL 3.0.2 (microsoft/WSL#41678) creates each distribution disk with a protected access list: the user, Administrators and the VM. CopySparse created its destination with default security, so disk move across volumes and disk snapshot gave the copy whatever its new folder allowed. Copy a protected list onto the new file; let an inherited one inherit as before. The comment on wsl --list --running --quiet was wrong: with nothing running it exits 0 and prints nothing (measured on 3.0.3, and WslClient.cpp only returns -1 without --quiet). Say so, and that this makes microsoft/WSL#41937's truncated output indistinguishable from "none". errors.json: WSAETIMEDOUT (0x8007274C), WSAENOBUFS and ERROR_INVALID_DATA get explanations from the WSL 3.0.x issues, and HCS_E_HYPERV_NOT_INSTALLED gets the damaged-components cause.
…ture back govulncheck fails on 1.27.1: crypto/x509 (GO-2026-6809, fixed in 1.27.3) and net/http and its http2 (GO-2026-6611 to 6617, fixed in 1.27.2). The protected-list test matched the user's SID as a string; on the CI runner the account is the built-in Administrator and SDDL prints it as LA. Check the fixture is protected with one entry instead.
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.
Three things from reading the WSL 3.0.1 to 3.0.4 releases and the issues filed since 3.0 went GA.
A copied disk keeps its user-only permissions
WSL 3.0.2 (microsoft/WSL#41678) creates each distribution disk with a protected access list: the user, Administrators and the VM.
CopySparsecreated its destination with default security, sodisk moveacross volumes anddisk snapshotgave the copy whatever its new folder allowed. It now copies a protected list onto the new file. An inherited list (a disk from an older WSL) still inherits, as before. A rename within one volume never had the problem.Measured, on WSL 3.0.3:
D:PAI(A;;FA;;;BA)(A;;FA;;;<user>)(A;;FA;;;<VM SID>)(A;;FA;;;<capability SID>).TestCopySparseKeepsAProtectedAccessListfails with the fix reverted. The copy came out as the temp folder's inherited list, including modify access for another local account.disk snapshotwroteD:P(A;;FA;;;BA)(A;;FA;;;<user>)into a folder that would otherwise have given it inherited entries.disk moveto a folder onD:kept the protected list. That folder givesEveryonefull control by inheritance, which is what the copy would have had.wsl --list --running --quietcomment correctedWith nothing running, it exits 0 and prints nothing. I measured that on 3.0.3, and
WslClient.cppreturns -1 only without--quiet. The old comment said otherwise. The code's behaviour was already right; the comment now also notes that this makes the truncated output in microsoft/WSL#41937 (security software ending wsl.exe before it flushed) impossible to tell apart from "none".Error dictionary
WSAETIMEDOUT/0x8007274C: three causes. The 3.0.3 new-session failure (#42029, #42006), after sleep (#41830), and mirrored mode (#42034).WSAENOBUFS: after Modern Standby (#41777).ERROR_INVALID_DATA: nested virtualization lost after KB5127648 on AMD hosts (#41917, warning added in #41942).HCS_E_HYPERV_NOT_INSTALLED: split into causes. The new one is damaged Windows components (#41994).doctor explain "Wsl/Service/0x8007274c"anddoctor explain 0x8007000dwere run against the built binary and print the new causes.Go 1.27.3
govulnchecknow fails on 1.27.1 for every branch: crypto/x509 (GO-2026-6809, fixed in 1.27.3) and net/http and http2 (GO-2026-6611 to 6617, fixed in 1.27.2).go.modmoves to 1.27.3; the full suite passes locally on it.