From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id BCA15AC0DF0 for ; Sat, 13 Apr 2024 09:37:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ari7nGSBaPagJuwwK+klaj8h74ybTzRVj0BhtbeGKLE=; 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:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1713001035; v=1; b=ibaLq3Dy4Du0QepmWBxs3WAqLp7qpdQfry8wEvi1TsjDW9s94Kmh8He8EcbhQvk9jMa/qzDu hAW++9NoV1jMqWtV0dqPOlzsi6FED6pWMtLOsxWfBZk7qEIrfgKp0hb/iicuotM/CJOYPXNfTTz 4SrW/SEOMOU/v3ZUbRbyMB5drVKGO7sr9ZtiqQhAvVJMdILEBE4uiO3OukddN7qFj8prRj4Q/fe OyDwwjk9lpvbMniWcQtPt9/DmgfLHeK25EswBXg2h6T5hByW0SvCyaoTVGsGKSF/3ACemjXxg0Y MoeXoN0GFt2sB4tHOW28RwCHzBE+P5au2HuWIA0LgcqIw== X-Received: by 127.0.0.2 with SMTP id k9QPYY7687511xwRgfPLjR69; Sat, 13 Apr 2024 02:37:15 -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.web10.7590.1713001029307170008 for ; Sat, 13 Apr 2024 02:37:09 -0700 X-Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-41687826509so25555e9.1 for ; Sat, 13 Apr 2024 02:37:09 -0700 (PDT) X-Gm-Message-State: szR0MsEwVT3oLfYYXrt41QzMx7686176AA= X-Google-Smtp-Source: AGHT+IHjYfY12OJgL/Vp71SvbVWmwj6vslJbyKiG9vfzmqYf34SWhnl77PDlvujuhycWNqrTkW1ER4uBLOpbtyQAaRI= X-Received: by 2002:a05:600c:45cb:b0:416:7385:b675 with SMTP id s11-20020a05600c45cb00b004167385b675mr72884wmo.7.1713001027409; Sat, 13 Apr 2024 02:37:07 -0700 (PDT) MIME-Version: 1.0 References: <94521f20aa2872c1b8f018b7db31eca4a2b8222d.1711039409.git.qinkun@google.com> In-Reply-To: From: "qinkun Bao via groups.io" Date: Fri, 12 Apr 2024 23:36:55 -1000 Message-ID: Subject: Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR. To: Ard Biesheuvel Cc: devel@edk2.groups.io, jiewen.yao@intel.com, Dionna Amalie Glaze , Mikko Ylinen , Gerd Hoffmann , James Bottomley , Tom Lendacky , Michael Roth , "linux-coco@lists.linux.dev" , "Aktas, Erdem" , Peter Gonda , "Johnson, Simon P" , "Xiang, Qinglan" , Cfir Cohen , "Madhanagopal, Ranga" 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: Sat, 13 Apr 2024 02:37:09 -0700 Resent-From: qinkun@google.com 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=ibaLq3Dy; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io Hi all, Thank you all for the feedback. > > In Intel, we had discussed and we did see the potential security risk. = As I mentioned in the first email, "In case that any the guest component on= ly 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." > > Thank you for bringing it up. Unfortunately, it is the current status even without this patch. On a TDX VM with Grub boot: TDVF, Shim, Grub extend their measurements into RTMR. Shim, Grub extend their measurements into TPM. We are seeking to add a non-default, build-time option that makes TDVF also extend its measurement into TPM. The measurement skew should not be a huge security concern. Yes, some environments won't be able to successfully attest. Again, we are talking about TDX VMs. The security property of a TEE should be based on the attestation results. The attestation verifier/service (e.g., Intel ITA) should examine the quote and check if the chain of trust is broken. And the end user should only be trusting attestations that contain full boot chains that are known to correctly measure every step into the relevant device. > > I think it is a bad idea to go and apply changes all across the boot > software ecosystem to measure the same assets into different > measurement protocols. I'mm afraid it creates technical debt that will > come and bite us in the future. Could you shed some lights on why it creates technical debts? > > Given that RTMR is a proper subset of vTPM (modulo the PCR/RTMR index > conversion), I feel that it should be the CoCo firmware's > responsibility to either: > - expose RTMR and not vTPM > - expose vTPM, and duplicate each measurement into RTMR as they are taken > > However, I understand that this is only viable for execution under the > UEFI boot services, and after that, the vTPM and RTMR are exposed in > different ways to the OS. Yes, they are exposed in different ways. In Linux, the TPM driver uses the mmio interface rather than the EFI service. Even if EFI_TCG2_PROTOCOL is not installed, the TPM as a device is still visible to the guest. The RTMR values are included in the TD report and could be extended through a TDCALL. The security concern caused by not measuring into every device that is available is a concern. Please see CVE-2021-42299. > > Could someone explain how that piece of the puzzle is supposed to > work? Do we measure into RTMR after ExitBootServices()? Yes, we still measure into RTMR after ExitBootServices() [1]. One example is measuring container images into RTMR2 during the loading [2]. Link: [1] https://lore.kernel.org/lkml/20240128212532.2754325-1-sameo@rivosinc.co= m/ [2] https://github.com/confidential-containers/guest-components/pull/467/ -=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 (#117719): https://edk2.groups.io/g/devel/message/117719 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-