edk2/MdeModulePkg/Core
Oliver Smith-Denny 5ccb5fff02 MdeModulePkg: DxeCore: Set Image Protections Through GCD
Today, SetUefiImageMemoryAttributes calls directly to the
CPU Arch protocol to set EFI_MEMORY_XP or EFI_MEMORY_RO on
image memory. However, this bypasses the GCD and so the GCD
is out of sync with the actual state of memory.

This can cause an issue in the scenario where a new attribute
is being set (whether a virtual attribute or a real HW attribute),
if the GCD attributes are queried for a region and the new attribute
is appended to the existing GCD attributes (which are incorrect),
then the incorrect attributes can get applied. This can result in
setting EFI_MEMORY_XP on code sections of images and causing an
execution fault.

This patch updates SetUefiImageMemoryAttributes to call into the
GCD to update the attributes there and let the GCD code call into
the CPU Arch protocol to update the page table.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-04-27 05:52:11 +00:00
..
Dxe MdeModulePkg: DxeCore: Set Image Protections Through GCD 2025-04-27 05:52:11 +00:00
DxeIplPeim MdeModulePkg/DxeIplPeim: Free scratch buffer after FV extraction 2024-12-06 10:17:16 +00:00
Pei MdeModulePkg: PeiMain: fix warning about uninitialized variable 2025-01-29 17:20:57 +01:00
PiSmmCore MdeModulePkg: PiSmmIpl: Fix physical address dereferencing 2025-04-21 06:07:39 +00:00
RuntimeDxe