All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Qinkun Bao <qinkun@google.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: devel@edk2.groups.io, jiewen.yao@intel.com,
	 Dionna Amalie Glaze <dionnaglaze@google.com>,
	Mikko Ylinen <mikko.ylinen@linux.intel.com>,
	 Gerd Hoffmann <kraxel@redhat.com>,
	James Bottomley <jejb@linux.ibm.com>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	Michael Roth <michael.roth@amd.com>,
	 "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	 Peter Gonda <pgonda@google.com>,
	"Johnson, Simon P" <simon.p.johnson@intel.com>,
	 "Xiang, Qinglan" <qinglan.xiang@intel.com>,
	Cfir Cohen <cfir@google.com>,
	 "Madhanagopal, Ranga" <ranga.madhanagopal@intel.com>
Subject: Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.
Date: Fri, 12 Apr 2024 23:36:55 -1000	[thread overview]
Message-ID: <CAOjUGWckeov-K45R1Mf=MvEYG7vDetrUh-ifQwZDTLMEVEmhpA@mail.gmail.com> (raw)
In-Reply-To: <CAMj1kXGm5RPNAzshaTAb7fnB80m8S+q0gbNxWSA3i9Dp-AL8uw@mail.gmail.com>

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 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."
> >

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.com/
[2] https://github.com/confidential-containers/guest-components/pull/467/

  parent reply	other threads:[~2024-04-13  9:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 16:59 [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR qinkun Bao
2024-03-21 17:46 ` Dionna Amalie Glaze
2024-03-22  2:39   ` Yao, Jiewen
2024-03-22  8:52     ` Gerd Hoffmann
2024-03-22 14:56       ` Dionna Amalie Glaze
2024-03-22 17:28         ` Qinkun Bao
2024-03-25 13:07         ` Mikko Ylinen
2024-03-25 15:28           ` Dionna Amalie Glaze
2024-04-11  1:20             ` Yao, Jiewen
2024-04-11  6:23               ` Qinkun Bao
2024-04-11  6:52               ` [edk2-devel] " Ard Biesheuvel
2024-04-11  8:07                 ` Gerd Hoffmann
2024-04-11  9:56                   ` Yao, Jiewen
2024-04-11 10:29                     ` kraxel
2024-04-11 10:33                       ` Ard Biesheuvel
2024-04-11 14:07                         ` Tom Lendacky
2024-04-11 17:10                           ` Xiang, Qinglan
2024-04-13  9:36                 ` Qinkun Bao [this message]
2024-04-15 14:42                   ` Ard Biesheuvel
     [not found] ` <17C329C4A6D0CD18.8175@lists.confidentialcomputing.io>
     [not found]   ` <CAOjUGWcNedJ7iNjGCKL6qZeZo3aSt_8U5BN=9JUN2f2vjD+O4w@mail.gmail.com>
     [not found]     ` <CA+2DEOoc1Ckn2S-=57HiRsAd0W4YGRWVQQG-gOBR3Fc8nfX+Nw@mail.gmail.com>
2024-04-09 19:16       ` Fwd: [External] Re: [linux-collab] [CCC][tac] " Qinkun Bao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOjUGWckeov-K45R1Mf=MvEYG7vDetrUh-ifQwZDTLMEVEmhpA@mail.gmail.com' \
    --to=qinkun@google.com \
    --cc=ardb@kernel.org \
    --cc=cfir@google.com \
    --cc=devel@edk2.groups.io \
    --cc=dionnaglaze@google.com \
    --cc=erdemaktas@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=jiewen.yao@intel.com \
    --cc=kraxel@redhat.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=michael.roth@amd.com \
    --cc=mikko.ylinen@linux.intel.com \
    --cc=pgonda@google.com \
    --cc=qinglan.xiang@intel.com \
    --cc=ranga.madhanagopal@intel.com \
    --cc=simon.p.johnson@intel.com \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.