From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8DFE9209574FB for ; Mon, 26 Feb 2018 02:23:13 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA2AB17CEF0; Mon, 26 Feb 2018 10:29:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86F0F2026DFD; Mon, 26 Feb 2018 10:29:16 +0000 (UTC) To: marcandre.lureau@redhat.com, edk2-devel@lists.01.org Cc: pjones@redhat.com, jiewen.yao@intel.com, stefanb@linux.vnet.ibm.com, qemu-devel@nongnu.org, javierm@redhat.com References: <20180223132311.26555-1-marcandre.lureau@redhat.com> <20180223132311.26555-8-marcandre.lureau@redhat.com> From: Laszlo Ersek Message-ID: Date: Mon, 26 Feb 2018 11:29:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180223132311.26555-8-marcandre.lureau@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 26 Feb 2018 10:29:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 26 Feb 2018 10:29:17 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH 7/7] ovmf: add DxeTpm2MeasureBootLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 10:23:14 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 02/23/18 14:23, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > The library registers a security management handler, to measure images > that are not measure in PEI phase. > > This seems to work for example with the qemu PXE rom: > > Loading driver at 0x0003E6C2000 EntryPoint=0x0003E6C9076 8086100e.efi > > And the following binary_bios_measurements log entry seems to be > added: > > PCR: 2 type: EV_EFI_BOOT_SERVICES_DRIVER size: 0x4e digest: 70a22475e9f18806d2ed9193b48d80d26779d9a4 > > CC: Laszlo Ersek > CC: Stefan Berger > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Marc-André Lureau > --- > OvmfPkg/OvmfPkgX64.dsc | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 2281bd5ff8..92ed9f3b0c 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -677,7 +677,10 @@ > MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { > > NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf > - } > +!if $(TPM2_ENABLE) == TRUE > + NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf > +!endif > + } > !else > MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > !endif > This looks OK to me. First, can you please clean up the SecurityStubDxe stanza as follows (as a separate patch): > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 96fc7b82e708..f4288b625cba 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -634,14 +634,12 @@ [Components] > > MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > > -!if $(SECURE_BOOT_ENABLE) == TRUE > MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { > > +!if $(SECURE_BOOT_ENABLE) == TRUE > NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf > - } > -!else > - MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > !endif > + } > > MdeModulePkg/Universal/EbcDxe/EbcDxe.inf > PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf The idea is that "SecurityStubDxe.inf" should be included unconditionally; only its plug-in libs should be conditional on various build flags. While the current (pre-patch) code does that -- in effect -- for SECURE_BOOT_ENABLE already, your patch (as-is) can only add TPM2_ENABLE *within* SECURE_BOOT_ENABLE. I don't think that's for the best -- first we should make DxeImageVerificationLib the *only* bit that's conditional on SECURE_BOOT_ENABLE, and then we can add DxeTpm2MeasureBootLib independently. (If neither build option is specified, we'll have a list that's empty, but that's perfectly fine.) Thanks! Laszlo