[CHERRY-PICK] MdeModulePkg: Don't Allow Guard Pages to Cross Bin Boundaries#1774
Merged
os-d merged 1 commit intomicrosoft:release/202511from Apr 23, 2026
Merged
[CHERRY-PICK] MdeModulePkg: Don't Allow Guard Pages to Cross Bin Boundaries#1774os-d merged 1 commit intomicrosoft:release/202511from
os-d merged 1 commit intomicrosoft:release/202511from
Conversation
…daries Currently, the DXE page allocator does not ensure that guard page allocations stay within the bin that it is attempting to allocate within. As a result, S4 resume is jeopardized by bins expanding due to guard pages, either into other bins or out of bins. This is caught by a new assert in CoreGetMemoryMap() to ensure the bins are correct. This fixes this by changing the internal heap guard API to return the adjusted size and start address of a proposed allocation. The page allocator then can ensure that the adjusted allocation still fits within the bin it is attempting to allocate within; if not, it will search for another descriptor. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com> (cherry picked from commit 0f2dc7558713f1774bb7317e9fdcd371fcbb10cc)
Contributor
✅ QEMU Validation PassedSource Dependencies
Results
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/24849449116 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
apop5
approved these changes
Apr 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1774 +/- ##
=================================================
Coverage ? 1.84%
=================================================
Files ? 1151
Lines ? 376642
Branches ? 3196
=================================================
Hits ? 6936
Misses ? 369650
Partials ? 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cfernald
approved these changes
Apr 23, 2026
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.
Description
Currently, the DXE page allocator does not ensure that guard page allocations stay within the bin that it is attempting to allocate within. As a result, S4 resume is jeopardized by bins expanding due to guard pages, either into other bins or out of bins. This is caught by a new assert in CoreGetMemoryMap() to ensure the bins are correct.
This fixes this by changing the internal heap guard API to return the adjusted size and start address of a proposed allocation. The page allocator then can ensure that the adjusted allocation still fits within the bin it is attempting to allocate within; if not, it will search for another descriptor.
(cherry picked from edk2 commit 0f2dc7558713f1774bb7317e9fdcd371fcbb10cc)
How This Was Tested
On OvmfPkg and a physical Intel system.
Integration Instructions
N/A.