summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe/DxeMain.inf
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-02-24 14:51:33 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-02-28 15:01:10 +0000
commit7eb927db3e25afdda1a5c5458c54bb79afc5bc8f (patch)
tree898a85433c2d6ca6dae86d0e78d8157694c34ae2 /MdeModulePkg/Core/Dxe/DxeMain.inf
parent973e388af2f8f35dce3aaa924a0372eedceeba96 (diff)
downloadedk2-7eb927db3e25afdda1a5c5458c54bb79afc5bc8f.tar.gz
edk2-7eb927db3e25afdda1a5c5458c54bb79afc5bc8f.tar.bz2
edk2-7eb927db3e25afdda1a5c5458c54bb79afc5bc8f.zip
MdeModulePkg/DxeCore: implement memory protection policy
This implements a DXE memory protection policy that ensures that regions that don't require executable permissions are mapped with the non-exec attribute set. First of all, it iterates over all entries in the UEFI memory map, and removes executable permissions according to the configured DXE memory protection policy, as recorded in PcdDxeNxMemoryProtectionPolicy. Secondly, it sets or clears the non-executable attribute when allocating or freeing pages, both for page based or pool based allocations. Note that this complements the image protection facility, which applies strict permissions to BootServicesCode/RuntimeServicesCode regions when the section alignment allows it. The memory protection configured by this patch operates on non-code regions only. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Core/Dxe/DxeMain.inf')
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.inf1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf
index 371e91cb0d..30d5984f7c 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.inf
+++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
@@ -191,6 +191,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileDriverPath ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy ## CONSUMES
# [Hob]
# RESOURCE_DESCRIPTOR ## CONSUMES