summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-12-04 10:41:08 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-12 10:53:16 +0000
commitcee7ba349c0c1ce489001a338a4e28555728b573 (patch)
treec63a0bf1c22962b4c1cdccfb1ff52f9efe42fa04 /ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
parent725acd0b9cc047b20a1b9379e46f05d3ebcf485e (diff)
downloadedk2-cee7ba349c0c1ce489001a338a4e28555728b573.tar.gz
edk2-cee7ba349c0c1ce489001a338a4e28555728b573.tar.bz2
edk2-cee7ba349c0c1ce489001a338a4e28555728b573.zip
ArmVirtQemu: Allow EFI memory attributes protocol to be disabled
Shim's PE loader uses the EFI memory attributes protocol in a way that results in an immediate crash when invoking the loaded image, unless the base and size of its executable segment are both aligned to 4k. If this is not the case, it will strip the memory allocation of its executable permissions, but fail to add them back for the executable region, resulting in non-executable code. Unfortunately, the PE loader does not even bother invoking the protocol in this case (as it notices the misalignment), making it very hard for system firmware to work around this by attempting to infer the intent of the caller. So let's introduce a QEMU command line option to indicate that the protocol should not be exposed at all, and a PCD to set the default for this option when it is omitted. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://gitlab.com/qemu-project/qemu/-/issues/1990 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf')
-rw-r--r--ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf3
1 files changed, 3 insertions, 0 deletions
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 997eb1a442..70e4ebf94a 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -46,6 +46,7 @@
PcdLib
PlatformBmPrintScLib
QemuBootOrderLib
+ QemuFwCfgSimpleParserLib
QemuLoadImageLib
ReportStatusCodeLib
TpmPlatformHierarchyLib
@@ -55,6 +56,7 @@
UefiRuntimeServicesTableLib
[FixedPcd]
+ gArmVirtTokenSpaceGuid.PcdUninstallMemAttrProtocol
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
@@ -73,5 +75,6 @@
[Protocols]
gEfiFirmwareVolume2ProtocolGuid
gEfiGraphicsOutputProtocolGuid
+ gEfiMemoryAttributeProtocolGuid
gEfiPciRootBridgeIoProtocolGuid
gVirtioDeviceProtocolGuid