openhcl: fix lower vtl permissions guard drop order and new failures (#4205) - #4213
Merged
Chris Oo (chris-oo) merged 1 commit intoAug 13, 2026
Conversation
…icrosoft#4205) Fix two bugs in lower vtl permissiosn guard. One is around drop ordering, where we must restore VTL protections to allocated pages before returning them to allocation pools, and the other is to handle partial failures on construction by rolling back protections.
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Steven Malis (smalis-msft)
approved these changes
Aug 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes correctness issues in the OpenHCL lower_vtl_permissions_guard around (1) ensuring VTL protections are restored before pages are returned to allocation pools, and (2) improving behavior when lowering permissions fails partway through guard construction.
Changes:
- Track successfully-updated PFNs during
PagesAccessibleToLowerVtlconstruction to enable rollback on partial failures. - Reorder
LowerVtlDmaBufferfields so the VTL guard is dropped before the underlyingMemoryBlock.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
openhcl/lower_vtl_permissions_guard/src/lib.rs |
Tracks updated pages during guard construction to support rollback on partial failures. |
openhcl/lower_vtl_permissions_guard/src/device_dma.rs |
Reorders fields to ensure VTL protections are restored before freeing the DMA MemoryBlock. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
45
to
49
| for pfn in pages { | ||
| vtl_protect | ||
| guard | ||
| .vtl_protect | ||
| .modify_vtl_page_setting(*pfn, hvdef::HV_MAP_GPA_PERMISSIONS_ALL) | ||
| .context("failed to update VTL protections on page")?; |
Chris Oo (chris-oo)
merged commit Aug 13, 2026
b85db1e
into
microsoft:release/1.8.2607
185 of 193 checks passed
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.
Fix two bugs in lower vtl permissiosn guard. One is around drop ordering, where we must restore VTL protections to allocated pages before returning them to allocation pools, and the other is to handle partial failures on construction by rolling back protections.
Clean cherry pick of (#4205).