Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Memory Protection Special Region Logic to Handle Edge Case #665

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c
TaylorBeebe marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2171,9 +2171,9 @@ SeparateSpecialRegionsInMemoryMap (
{
MapEntryStart = (UINTN)MemoryMapEntry->PhysicalStart;
MapEntryEnd = (UINTN)MemoryMapEntry->PhysicalStart + (UINTN)EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages);
if ((MapEntryStart <= SpecialRegionStart) && (MapEntryEnd > SpecialRegionStart)) {
// Check if some portion of the map entry isn't covered by the special region
if (MapEntryStart != SpecialRegionStart) {
if (CHECK_OVERLAP (SpecialRegionStart, SpecialRegionEnd, MapEntryStart, MapEntryEnd)) {
// Check if some portion before the map entry isn't covered by the special region
if (MapEntryStart < SpecialRegionStart) {
// Populate a new descriptor for the region before the special region. This entry can go to the end
// of the memory map because the special region list is sorted
POPULATE_MEMORY_DESCRIPTOR_ENTRY (
Expand Down