summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-08 10:32:03 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2019-04-14 18:37:30 -0700
commit26d60374b87d7ed4b0ded88f95a3eb991680e134 (patch)
tree636031827cf203e53ead4db8752aa7d14816df5d /MdeModulePkg/Library
parent615a72400bca338aa92579a726c4669b4185dc43 (diff)
downloadedk2-26d60374b87d7ed4b0ded88f95a3eb991680e134.tar.gz
edk2-26d60374b87d7ed4b0ded88f95a3eb991680e134.tar.bz2
edk2-26d60374b87d7ed4b0ded88f95a3eb991680e134.zip
MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images
Allow PE/COFF images that must execute under emulation for Driver#### options, by removing the redundant machine type check from the BDS code. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 7bead7d956..07592f8ebd 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -1227,10 +1227,8 @@ BmIsLoadOptionPeHeaderValid (
// Check PE32 or PE32+ magic, and machine type
//
OptionalHeader = (EFI_IMAGE_OPTIONAL_HEADER32 *) &PeHeader->Pe32.OptionalHeader;
- if ((OptionalHeader->Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC ||
- OptionalHeader->Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) &&
- EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeHeader->Pe32.FileHeader.Machine)
- ) {
+ if (OptionalHeader->Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC ||
+ OptionalHeader->Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
//
// Check the Subsystem:
// Driver#### must be of type BootServiceDriver or RuntimeDriver