From 41be3d37d6b1bd5ca802ff9e0d559ac398dc1367 Mon Sep 17 00:00:00 2001 From: ocbuild Date: Sun, 29 Oct 2023 14:00:54 +0000 Subject: [PATCH] OvmfPkg: Apply PcdImageLoaderRemoveXForWX --- OvmfPkg/OvmfPkgIa32.dsc | 3 +++ OvmfPkg/OvmfPkgIa32X64.dsc | 3 +++ OvmfPkg/OvmfPkgX64.dsc | 3 +++ 3 files changed, 9 insertions(+) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index d05a07ec25..e7e45376dd 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -589,6 +589,9 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x0 !endif + # Fix incorrect W^X permissions at load time. + gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRemoveXForWX|TRUE + ################################################################################ # # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index bdadd7bcd5..b434219152 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -554,6 +554,9 @@ gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask|0x1 gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003 + # Fix incorrect W^X permissions at load time. + gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRemoveXForWX|TRUE + [PcdsFixedAtBuild.IA32] # # The NumberOfPages values below are ad-hoc. They are updated sporadically at diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 7bcf662640..ad89dc14ed 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -617,6 +617,9 @@ gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE !endif + # Fix incorrect W^X permissions at load time. + gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRemoveXForWX|TRUE + ################################################################################ # # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform