All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Qinkun Bao <qinkun@google.com>
To: PH0PR11MB587959168F72B20E0AC836438C312@ph0pr11mb5879.namprd11.prod.outlook.com
Cc: Dionna Glaze <dionnaglaze@google.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	devel@edk2.groups.io,  Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	 "Yao, Jiewen" <jiewen.yao@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	linux-coco@lists.linux.dev,  Michael Roth <michael.roth@amd.com>,
	Peter Gonda <pgonda@google.com>, Qinkun Bao <qinkun@google.com>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	Cfir Cohen <cfir@google.com>,  Chris Fenner <cfenn@google.com>,
	Ronald Aigner <ronaldaigner@google.com>,
	mingshen.sun@tiktok.com,  mikko.ylinen@linux.intel.com
Subject: Fwd: [External] Re: [linux-collab] [CCC][tac] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.
Date: Tue, 9 Apr 2024 09:16:40 -1000	[thread overview]
Message-ID: <CAOjUGWfMAxpZvMub=tqdAtinEFop6nRUrzFBwcn4Ke-f+erVtw@mail.gmail.com> (raw)
In-Reply-To: <CA+2DEOoc1Ckn2S-=57HiRsAd0W4YGRWVQQG-gOBR3Fc8nfX+Nw@mail.gmail.com>

I brought the RFC into the CCC community
(https://github.com/confidential-computing/governance) and received
some comments.

Forward the email into the EDK2 dev and linux-coco.

Thanks,
Qinkun

---------- Forwarded message ---------
From: Mingshen Sun <mingshen.sun@tiktok.com>
Date: Thu, Apr 4, 2024 at 1:43 PM
Subject: Re: [External] Re: [linux-collab] [CCC][tac] [RFC PATCH]
OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and
RTMR.
To: <qinkun@google.com>
Cc: <tac@lists.confidentialcomputing.io>,
<linux-collab@lists.confidentialcomputing.io>


Hi Qinkun,

Thanks for bringing this to the CCC community.

I think the proposal makes sense to me. RTMR and vTPM measurements
shouldn't be mutually exclusive.

Under certain threat models (e.g., workload operator is not trusted),
both of them may be valid.
1. Measurements of RTMR and vTPM can be used for cross validation with
different root-of-trust.
2. Key sealing feature provided by vTPM is not available in the
current TEE ecosystem.

Mingshen


On Thu, Apr 4, 2024 at 12:32 PM qinkun Bao via


lists.confidentialcomputing.io
<qinkun=google.com@lists.confidentialcomputing.io> wrote:
>
> Hello,
>
> The current TDVF implementation does not extend to the vTPM if the
> RTMR attestation is enabled. We are working on proposals to address
> the issue. We would like to get the feedback from the CCC community
> about the proposal.
>
> Thanks,
> Qinkun
>
> On Thu, Apr 4, 2024 at 12:16 PM qinkun Bao via
> lists.confidentialcomputing.io
> <qinkun=google.com@lists.confidentialcomputing.io> wrote:
> >
> >
> >
> > ---------- Forwarded message ---------
> > From: qinkun Bao <qinkun@google.com>
> > Date: Thu, Mar 21, 2024 at 9:59 AM
> > Subject: [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.
> > To: <devel@edk2.groups.io>
> > Cc: <linux-coco@lists.linux.dev>, Erdem Aktas <erdemaktas@google.com>, Jiewen Yao <jiewen.yao@intel.com>, Ard Biesheuvel <ardb@kernel.org>, Peter Gonda <pgonda@google.com>, Dionna Glaze <dionnaglaze@google.com>, Qinkun Bao <qinkun@google.com>, James Bottomley <jejb@linux.ibm.com>, Gerd Hoffmann <kraxel@redhat.com>, Tom Lendacky <thomas.lendacky@amd.com>, Michael Roth <michael.roth@amd.com>
> >
> >
> > From: Qinkun Bao <qinkun@google.com>
> >
> > The UEFI v2.10 spec defines the protocol EFI_CC_MEASUREMENT_PROTOCOL
> > to enable (for example) RTMR-based boot measurement for TDX VMs.
> > With the current UEFI spec’s “should not” wording and EDK2
> > implementation, TPM measurement in TDVF is disabled when
> > RTMR measurement is enabled.
> >
> > Mutual exclusion of the CC measurement protocol and TCG measurement
> > protocol breaks backwards compatibility, which makes adoption of RTMRs
> > challenging. A virtualized TPM device (vTPM) managed by the host VMM
> > makes boot measurements visible to the VMM operator, but this is an
> > oft-requested feature that users can choose to accept.
> >
> > The TPM has been a standard for over a decade and many existing
> > applications rely on the TPM. Both inside and outside Google,
> > we have many users that require vTPM, including features that are
> > not easily available via RTMRs (e.g. sealing using keys that the
> > guest OS cannot access).
> >
> > This patch adds a non-default build option to allow the coexistence
> > of both the CC measurement and TCG protocols. Not included is a
> > vendor-specific measured event in the CC event log that indicates
> > whether a vTPM is attached or not.
> >
> > Cc: Erdem Aktas <erdemaktas@google.com>
> > Cc: James Bottomley <jejb@linux.ibm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Tom Lendacky <thomas.lendacky@amd.com>
> > Cc: Michael Roth <michael.roth@amd.com>
> > Signed-off-by: Qinkun Bao <qinkun@google.com>
> > ---
> >  OvmfPkg/OvmfPkgX64.dsc                               |  9 ++++++++-
> >  .../DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c    | 12 +++++++++++-
> >  .../DxeTpmMeasurementLib/DxeTpmMeasurementLib.c      |  6 ++++++
> >  3 files changed, 25 insertions(+), 2 deletions(-)
> >
> > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> > index 56c920168d..9bcee45047 100644
> > --- a/OvmfPkg/OvmfPkgX64.dsc
> > +++ b/OvmfPkg/OvmfPkgX64.dsc
> > @@ -32,7 +32,8 @@
> >    DEFINE SECURE_BOOT_ENABLE      = FALSE
> >    DEFINE SMM_REQUIRE             = FALSE
> >    DEFINE SOURCE_DEBUG_ENABLE     = FALSE
> > -  DEFINE CC_MEASUREMENT_ENABLE   = FALSE
> > +  DEFINE CC_MEASUREMENT_ENABLE   = TRUE
> > +  DEFINE CC_MEASUREMENT_AND_TCG2_COEXIST  = FASLE
> >
> >  !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
> >
> > @@ -99,6 +100,11 @@
> >    INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
> >  !endif
> >    RELEASE_*_*_GENFW_FLAGS = --zero
> > +!if $(CC_MEASUREMENT_ENABLE) == TRUE && $(CC_MEASUREMENT_AND_TCG2_COEXIST) == TRUE
> > +  MSFT:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  INTEL:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  GCC:*_*_*_CC_FLAGS = -D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +!endif
> >
> >    #
> >    # Disable deprecated APIs.
> > @@ -1045,6 +1051,7 @@
> >    }
> >  !endif
> >
> > +
> >    #
> >    # TPM support
> >    #
> > diff --git a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > index 73719f3b96..4c9bc8ab4a 100644
> > --- a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > +++ b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > @@ -325,7 +325,12 @@ Tcg2MeasureGptTable (
> >      }
> >
> >      DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasureGptTable - %r\n", Status));
> > +#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  }
> > +  if (Tcg2Protocol != NULL) {
> > +#else
> >    } else if (Tcg2Protocol != NULL) {
> > +#endif
> >      //
> >      // If Tcg2Protocol is installed, then Measure GPT data with this protocol.
> >      //
> > @@ -493,7 +498,12 @@ Tcg2MeasurePeImage (
> >                             CcEvent
> >                             );
> >      DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasurePeImage - %r\n", Status));
> > -  } else if (Tcg2Protocol != NULL) {
> > +#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +   }
> > +   if (Tcg2Protocol != NULL) {
> > +#else
> > +   } else if (Tcg2Protocol != NULL) {
> > +#endif
> >      Status = Tcg2Protocol->HashLogExtendEvent (
> >                               Tcg2Protocol,
> >                               PE_COFF_IMAGE,
> > diff --git a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
> > index 6f287b31fc..b1c6198b4b 100644
> > --- a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
> > +++ b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
> > @@ -261,7 +261,11 @@ TpmMeasureAndLogData (
> >                 HashData,
> >                 HashDataLen
> >                 );
> > +#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  }
> > +#else
> >    } else {
> > +#endif
> >      //
> >      // Try to measure using Tpm20 protocol
> >      //
> > @@ -287,7 +291,9 @@ TpmMeasureAndLogData (
> >                   HashDataLen
> >                   );
> >      }
> > +#ifndef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> >    }
> > +#endif
> >
> >    return Status;
> >  }
> > --
> > 2.44.0.291.gc1ea87d7ee-goog
> >
> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#2): https://lists.confidentialcomputing.io/g/linux-collab/message/2
> Mute This Topic: https://lists.confidentialcomputing.io/mt/105336026/7779031
> Group Owner: linux-collab+owner@lists.confidentialcomputing.io
> Unsubscribe: https://lists.confidentialcomputing.io/g/linux-collab/unsub [mingshen.sun@tiktok.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

      parent reply	other threads:[~2024-04-09 19:16 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
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       ` Qinkun Bao [this message]

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='CAOjUGWfMAxpZvMub=tqdAtinEFop6nRUrzFBwcn4Ke-f+erVtw@mail.gmail.com' \
    --to=qinkun@google.com \
    --cc=PH0PR11MB587959168F72B20E0AC836438C312@ph0pr11mb5879.namprd11.prod.outlook.com \
    --cc=ardb@kernel.org \
    --cc=cfenn@google.com \
    --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=mingshen.sun@tiktok.com \
    --cc=pgonda@google.com \
    --cc=ronaldaigner@google.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.