Skip to content

Impersonate the caller before making various filesystem operations - #41689

Merged
Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/impersonate-path
Sep 24, 2026
Merged

Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/impersonate-path

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds impersonation logic to various places where wslservice performs filesystem operations

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI lite review requested due to automatic review settings September 23, 2026 22:54
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner September 23, 2026 22:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

WSL2 compression detection still needs caller-token impersonation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds caller/user-token impersonation around WSL service filesystem operations.

Changes:

  • Impersonates callers during distribution path validation and directory creation.
  • Uses the user token for rootfs compression checks.
File Summary
src/​windows/​service/​exe/​LxssUserSession.cpp Adds impersonation for path validation and directory operations.
src/​windows/​service/​exe/​LxssInstance.cpp Adds user-token impersonation for rootfs attribute checks; the corresponding WSL2 check remains unresolved.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/windows/service/exe/LxssInstance.cpp
Copilot AI review requested due to automatic review settings September 23, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

@benhillis Ben Hillis (benhillis) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok to me, I guess we should impersonate even when checking the attributes as well.

@OneBlue
Blue (OneBlue) merged commit a153d88 into master Sep 24, 2026
12 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/impersonate-path branch September 24, 2026 17:13
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