From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 81F48D8081E for ; Tue, 26 Mar 2024 15:52:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=A75EQ2OobEX+1YNSIx0FJkSb8jM4G82whpzuS78oO/M=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1711468337; v=1; b=4WRCM421Fisnv7F3yeFcK+YNhJBor/4KT+XJPVM9afvYEY6BFbsnw0NZBz9a5xeo273XI9f0 +kVL/hbl7ABCn+ZJJKfMuUw+DkltKyl0Hz3EYNkBaIIreZhsKpsSEaisNX3CgmYSMoRhKbS0plK 4j/CP7uyZLDIUkA3nMtgXFmCP2/cehwlbz7h5WsbqNzjWsaajHoqfxV3MKeYsIBydAbaOJgpinw MWnYroyWC+a9T51RisHuC8v9EXhQO5ewBXlBZhJ/3kVd/d3QGWoToRAsFjd4fGCzUCYHtjm5RD3 LBkJfSNB587IWuXGr1K/SWCeE4XEdMdEWAcQHyx4BPupg== X-Received: by 127.0.0.2 with SMTP id MQwSYY7687511x5yiDxUZCws; Tue, 26 Mar 2024 08:52:17 -0700 X-Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web11.1222.1711128534785316695 for ; Fri, 22 Mar 2024 10:28:55 -0700 X-Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4140eed8a4fso5905e9.0 for ; Fri, 22 Mar 2024 10:28:54 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVKTvvMnJ8iRLlQ79UcPPhWjcviQ+ZxxaTWHehNv5KvS8ZwzVEG+JtakjlCYr08Pl9tMEkFl7aN+sWbOjWd9bCFpvPsGg== X-Gm-Message-State: mYvhuFIs9whbRTWvuMXO7pQbx7686176AA= X-Google-Smtp-Source: AGHT+IFNz3OvUvxwK5zd02bbnjlbPXEFlCYTKKtIe//eLxsCkm+JKvnTuE0WPTuNw9hVBcCnjBXmKRPmVcFJXSsL9Xk= X-Received: by 2002:a05:600c:3b94:b0:413:f266:c654 with SMTP id n20-20020a05600c3b9400b00413f266c654mr495882wms.1.1711128532974; Fri, 22 Mar 2024 10:28:52 -0700 (PDT) MIME-Version: 1.0 References: <94521f20aa2872c1b8f018b7db31eca4a2b8222d.1711039409.git.qinkun@google.com> In-Reply-To: From: "qinkun Bao via groups.io" Date: Fri, 22 Mar 2024 10:28:41 -0700 Message-ID: Subject: Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR. To: Dionna Amalie Glaze Cc: Gerd Hoffmann , "Yao, Jiewen" , "devel@edk2.groups.io" , "linux-coco@lists.linux.dev" , "Aktas, Erdem" , Ard Biesheuvel , Peter Gonda , James Bottomley , Tom Lendacky , Michael Roth Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 26 Mar 2024 08:52:15 -0700 Reply-To: devel@edk2.groups.io,qinkun@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=4WRCM421; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io On Fri, Mar 22, 2024 at 7:57=E2=80=AFAM Dionna Amalie Glaze wrote: > > On Fri, Mar 22, 2024 at 1:52=E2=80=AFAM Gerd Hoffmann = wrote: > > > > On Fri, Mar 22, 2024 at 02:39:20AM +0000, Yao, Jiewen wrote: > > > Please aware that this option will cause potential security risk. > > > > > > In case that any the guest component only knows one of vTPM or RTMR, > > > and only extends one of vTPM or RTMR, but the other one only verifies > > > the other, then the chain of trust is broken. This solution is secur= e > > > if and only if all guest components aware of coexistence, and can > > > ensure all measurements are extended to both vTPM and RTMR. But I am > > > not sure if all guest components are ready today. > > Thank you for the feedback. I believe it is the existing status even without the patch. Both EFI_CC_MEASUREMENT_PROTOCOL and EFI_TCG2_PROTOCOL are exposed by TDVF when CC_MEASUREMENT_ENABLE is set to true even without the patch. TDVF only measures with EFI_CC_MEASUREMENT_PROTOCOL protocol. However, since both protocols exist, Shim and Grub2 measure into both CCand TPM. In the guest, the user can access both the event log f= or TPM andvRTMR. Some of the event logs for TPM are missing without the patch. As Dionna mentioned (CVE-2021-42299), measuring into every device that is available seems to be a safer choice. It's a mistake we've concretely made in the past. I am thinking your biggest concern is OS. Fortunately, there is no accepted patch in the kernel that appears to have EFI_CC_MEASUREMENT_PROTOCOL support. Once this patch is accepted, we will work with the kernel community to recommend the following code pattern "for device in measurement_devices: device.Extend(bla)" for all guest components. > > As far I know (it's been a while I looked at those patches) shim.efi an= d > > grub.efi have support for EFI_CC_MEASUREMENT_PROTOCOL, but use the same > > logic we have in DxeTpm2MeasureBootLib, i.e. they will not measure to > > both RTMR and vTPM. > > Shim will measure into CC and then continue to measure into TPM > https://github.com/rhboot/shim/blob/126a07ebc30bbd203b6966465b058da741b26= 54b/tpm.c#L164 > > GRUB2 has the same behavior. We can at least get coexistence > supporting the current boot integrity strategy that Confidential Space > is using, which is to depend on a dmverity initramfs whose root hash > is in the kernel_cmdline, and a Linux kernel built with LOADPIN. The > changes to Linux are proposed but not accepted precisely due to this > conversation we're having now. > I recall describing this to another CSP engineer at an IETF meeting > and they claimed they used the same approach, but I can't remember if > that was Oracle or another company. > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117132): https://edk2.groups.io/g/devel/message/117132 Mute This Topic: https://groups.io/mt/105070442/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-