From patchwork Mon Apr 1 03:27:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 161514 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4874610jan; Sun, 31 Mar 2019 20:27:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqysP2zNko2WDfFskkFXd99zSr0Bs4N7QuGGUEtEsgHwBiDSwS1Ii534mzLYJOn5l+tqfXhA X-Received: by 2002:a17:902:7785:: with SMTP id o5mr42546458pll.33.1554089255868; Sun, 31 Mar 2019 20:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554089255; cv=none; d=google.com; s=arc-20160816; b=A2bZ2OJl8GxbpKqUxECVON/I+wnfhrw291s+KnpW8Jo85cI2JHIkjgMMhKwEF8uBoc jpMZ5YK+VPCAePRqvLN9XzgtR9w3AbePVXBo22oXfP1n/XSFvQBlRWeeV0FKPed11bKL 7Ja/MlLj8C41l7cUOp1X3UPBgKoXGSIQ8sT4ZJLGAHsKAW6KcwGqmsMs2I20grwf0fMH A0ZM9VQouZvCBVkCIlFEyCYp9rWfQWVA1YQzY2AwcNQk0L/mrKk7VoXvBIvxTz+Sf2Nb xG3+sXgI7JK0G+P/FA0BTpclpg+GiWKiZFXhjMbH4x3F0EVzRCLmbgntosC1Sw8HwKPI 7HFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=3gTIJ6DCkxrpeNSvae6S5fmjuAgb/GLUHJ4wbjJnRdI=; b=NKtEpVA1HWZTkdwtqI6M13D+tkva3hbmcZCQrUfd1Cdv/UvbFMpBR37UnbhCjFzN3x A91xzHvKlnDTiavUV5vgwc2SXPMcK9QbxY6L4riavSA8uBnBpQ8yGizLeSay2bzoUl8V 1+EnnZ2NTvGZcELrZsbTAH9vhXByRqcFBSQPvZwHfs1adopTZqTMdbKli0gdFUHMMOL0 x5rIhvimUtkkJxfcgc11Kr5qwm42r6Poqf58EnLR5imf5BSuaXC33HAydAoeOYAoxFkc z4TEzpzN0pRS2uDOTx4uFMc3bR7CvJcATVn7JHHfd+rN6/nkJRvzUiZ1LIfNoGFq/dB6 akUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U1xNR+uO; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id f40si8226267plb.339.2019.03.31.20.27.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Mar 2019 20:27:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U1xNR+uO; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7EE2F211EDB3D; Sun, 31 Mar 2019 20:27:35 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4DA40211E011B for ; Sun, 31 Mar 2019 20:27:34 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id i17so3816924pfo.6 for ; Sun, 31 Mar 2019 20:27:34 -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=U1xNR+uOfmVvW1F8PROm71pYR79pKSG/+GgvQek2XknOYxuAgQriCXXdpLhb7taV1O /ADGACv6FQVFtzcEdS543kBzay575sdQtuVHnBgc2Mr3DfuiyXt5xapoh3N1coaGL/Nj 2mly2fTR0fUkbvw7dea/Sv5QIchfuHd6RwAiJsFhor4QJzz41QDlm/cOPepGl4xpWIs3 ZKZ0wj72oJEDmvj7hSmdV9osMOQxF2ox7ZxdD5E7cgCN0RzQTzICV+7Nd1snabKL1DPL q4wiQhJHRl7VGx5HeY+CKeJ2Vi1I4wVIRcuLHgva9rIcOPeyrj3bsxJcKCEYyrr3JMwf ihYA== 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=KqnUFMiZpvZ71eYPflxR1JuHNmx9lIS69RyXQiBJmQDYOHjBXfr5UroKZmM4XNMdML dROU9DNu1PKcpKMZMskJf0XEL4qx6wNUQcukpGHT5NvDG6FruQ0F4wcBDTIkc2K7i0vx Wo1ny8YmCW2L1Wtj8QhGsPhNKEGZGrkoM73DX0LbJ+Z3cncHZKjwDFFC9Z5lr/F1AT2O fIxBxgLdOGuJASAQBZL2xXj905DtVDQ67kOKNHJEMlBHWIfVXNwf5DJNNTGXQL/LxtqC rCcAS7lWFdKYkbbErmPneGPvY1y/1/a4A1Ai0wAUBxBRe70d5oBAMlTb5FKgaj9jA9Y4 y0+A== X-Gm-Message-State: APjAAAUwsYKgfyzhuwyb3jzHf3oBLDCtUHKKelATgXZtoADHx1BI7PpH lSByoR71iUohRB6MMseEYzBsQ88U5onmFQ== X-Received: by 2002:aa7:91d7:: with SMTP id z23mr21194335pfa.137.1554089253475; Sun, 31 Mar 2019 20:27:33 -0700 (PDT) Received: from mba13.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id 16sm12758092pfz.106.2019.03.31.20.27.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Mar 2019 20:27:32 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 1 Apr 2019 10:27:06 +0700 Message-Id: <20190401032709.14787-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401032709.14787-1-ard.biesheuvel@linaro.org> References: <20190401032709.14787-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v4 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Vincent Zimmer , Eric Dong , Jaben Carsey , Brian Richardson , Liming Gao , Michael D Kinney , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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