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=iTWQAFY5; spf=pass (domain: linaro.org, ip: 209.85.210.194, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by groups.io with SMTP; Sun, 14 Apr 2019 12:52:57 -0700 Received: by mail-pf1-f194.google.com with SMTP id t21so7527727pfh.2 for ; Sun, 14 Apr 2019 12:52:57 -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=Lt4c/AdNUsuWgytvRuumQ2JYjxI9N3vTvgyPsBFpAZU=; b=iTWQAFY5UDPe/cxNuUTC/D4bUFcrCeOtNcVEaedHVpf96CHVfK9oGfk0GxzOZEVPaD PocOwXfmrKObmHGIjnoOfJ0JTyfWwcOMWdW70tJSb6nileb7a9Ez4IM9F8b3jrM/jTWi oJILx5EJjOFWB8/iXBU2kKHrx/vYI/mmUYBq0j3FtbKNbR83xD1oJy5wcLSiHzrG5zqV SEY4VexNRQtTz6CbWuo484YUz6z0krNJd2uFSXraaMbrBPiwG9Ss6JMakW/NKKN7Ipm4 0VnP5tx7szuwV+QMx9dVQxQmpYjRUSlluXwutZ5H+12NZT/o0IxVS2fa65xWnOPA89iv uTHg== 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=Lt4c/AdNUsuWgytvRuumQ2JYjxI9N3vTvgyPsBFpAZU=; b=GIanjHtdgbTkIPnBFoBMad96hMaQjUbfVAF0rQW8Sc/YUWfAOcWE4G8kQ5JqZH1heF 0GwlVLVPTJx8Hv+PY1FD6j7bUeiC5Ti2FbSoryB+I3QqOPomdWldiGMZUJKxSyQWnn8C xRI++u85nWqvjgdCqhBXRSexiUSbtWhA55I3hj6gjr5kveqXX1zfjSLcSlGv3Q18hrg2 iPFESlrG11ObPjT0llQ9bp2KJvE4m42rSfW9nisrc47l4XRcCgqNSq7mWsqa7K7OxOVG HuI5c3e8yiRFEu/s8CAAdXTL0+WaR1vbrmE1FmogF/vTKPhkW94N34PY6W7K4oLUu5nW RUCw== X-Gm-Message-State: APjAAAWFsp540y8aXEwgZ3uWrGCE8KYk/gpooXhjmxXW4C3k+scefDxT hlAX1sdyLvhfn8vCNwYf1clRo8lOiXqdxZ+P X-Google-Smtp-Source: APXvYqxz22fXlfu1SHSjzZbI6y20ko1Jqs1O5hqbJO2PLUZWWbZHFH95Re/YVTcACy5hoa51qE9KCA== X-Received: by 2002:a62:1a0d:: with SMTP id a13mr71997717pfa.198.1555271576879; Sun, 14 Apr 2019 12:52:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.236.184.206]) by smtp.gmail.com with ESMTPSA id j16sm62388977pfi.58.2019.04.14.12.52.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Apr 2019 12:52:56 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael D Kinney , Andrew Fish , Leif Lindholm , Star Zeng , Eric Dong , Ruiyu Ni , Liming Gao , Jaben Carsey , Steven Shi , Jian J Wang , Hao Wu Subject: [PATCH v6 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images Date: Sun, 14 Apr 2019 12:52:30 -0700 Message-Id: <20190414195233.30045-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190414195233.30045-1-ard.biesheuvel@linaro.org> References: <20190414195233.30045-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. Signed-off-by: Ard Biesheuvel Reviewed-by: Michael D Kinney --- 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