From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=P1/FB5Xv; spf=pass (domain: linaro.org, ip: 209.85.215.193, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by groups.io with SMTP; Thu, 11 Apr 2019 11:58:27 -0700 Received: by mail-pg1-f193.google.com with SMTP id d31so3941453pgl.7 for ; Thu, 11 Apr 2019 11:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kJwAjnz7dW3QayejO1nSzFv7Z+xOomqoKI6R/KOcWkw=; b=P1/FB5XvhFOM2cFR+kgz9UEUE41y0+qmEPqBmdrHWJNhTsa6+B2dLX9kJh2mgys3zA fLPgXZ4Q2L/6MHSKZkauhl1b+kmtnJWyP5UJcRek6Bpakf7W6xZ7pt0Sj+hNl73DTMnC 4chlqvY2XcffUoRzBBmyT9mfgvNRueKH/FOb/gwOLRfXXNFr7cMCk4aGFFJ66hPl+zzP 7VhO5a4qrVoWfkLIbyb5wUr/95LmFLTcrFkka2XmdqQoRNEw+J+RPHYwfwkDlM5kEslU PKSCWf+/hUeS8+0glTx5OVENr4jp+mEWwsdVmvyJLnF+efN1KWPdeRQxT5nH07vrqhE4 5Ejg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kJwAjnz7dW3QayejO1nSzFv7Z+xOomqoKI6R/KOcWkw=; b=S2d7LsZpZLhnaCCJAXqkpQs+lMamcsIDmYF8F2ClMFGxAy9GSq9DGZWgNdoOzXfHLh W5+Ug5M8l7X6ojdkocEcV4eCxzerLaWhXbZlGwc2oqzt8I4Z9c89jVvwp9zaLGuTqoh1 0qD4WmScTbFc+qK64JorzYfOy05EfBvVB32yWlYjSH5qQjb4jqfnZtwU1u7hykYxqzH7 DP2MCOS5euPIFnorkOKalOuFmA4KJoxaY93igFEM/DJe67cLNuBmTiB+aFRQXMCIuK7C yoIcKBkXhfIr3mDZB/qe0mALw0f8QIaW0cgdu4Vq9F/uEgqbZgPv0PnLQjilUsJ1TaCE wv0Q== X-Gm-Message-State: APjAAAWTxL00Ca3oRnop5SUsJGOMWu6du2SZBUovFb1drYkJ0LBZNEL5 81jeDLRQNsMf774b25XOFIB/7wC76Vve0Zih X-Google-Smtp-Source: APXvYqycUjed1UqXE06+YJeW1mxwZTGQp6HSao6TpmLC6AIhjTW4orTwbqlFZKWu30CiWHPbnHfFiw== X-Received: by 2002:aa7:864a:: with SMTP id a10mr51834172pfo.181.1555009105976; Thu, 11 Apr 2019 11:58:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain (50-205-23-12-static.hfc.comcastbusiness.net. [50.205.23.12]) by smtp.gmail.com with ESMTPSA id w3sm82712861pfn.179.2019.04.11.11.58.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 11:58:25 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Vincent Zimmer , Brian Richardson , Michael D Kinney , Andrew Fish , Leif Lindholm , Star Zeng , Eric Dong , Ruiyu Ni , Liming Gao , Jaben Carsey , Steven Shi Subject: [PATCH v5 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images Date: Thu, 11 Apr 2019 11:58:10 -0700 Message-Id: <20190411185813.2084-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190411185813.2084-1-ard.biesheuvel@linaro.org> References: <20190411185813.2084-1-ard.biesheuvel@linaro.org> Allow PE/COFF images that must execute under emulation for Driver#### options, by removing the redundant machine type check from the BDS code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c index 7bf96646c690..8e6caaa63548 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c @@ -1233,10 +1233,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 -- 2.17.1