edk2/MdeModulePkg/Core/Dxe
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
..
Dispatcher MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
DxeMain MdeModulePkg DxeMain: Add late initialization for Debug Agent. 2024-12-16 20:49:45 +00:00
Event MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FwVol MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c 2023-09-11 02:17:51 +00:00
FwVolBlock MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c 2023-09-11 02:17:51 +00:00
Gcd MdeModulePkg: DxeCore: Set Image Protections Through GCD 2025-04-27 05:52:11 +00:00
Hand MdeModulePkg: fix warning about uninitialized variable 2025-01-29 17:20:57 +01:00
Image MdeModulePkg: Fix redundant call to RestoreTpl() 2024-09-04 00:53:54 +00:00
Library MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Mem MdeModulePkg: Remove EFI_MEMORY_* Defines 2024-07-26 03:08:20 +00:00
Misc MdeModulePkg: DxeCore: Set Image Protections Through GCD 2025-04-27 05:52:11 +00:00
SectionExtraction MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
DxeCore.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
DxeCoreExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
DxeMain.h MdeModulePkg: CoreValidateHandle Optimization 2024-08-30 11:42:41 +00:00
DxeMain.inf MdeModulePkg: CoreValidateHandle Optimization 2024-08-30 11:42:41 +00:00