public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: "Xu, Min M" <min.m.xu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"kraxel@redhat.com" <kraxel@redhat.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	"Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>, nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH V4 3/3] SecurityPkg: Support CcMeasurementProtocol in DxeTpmMeasurementLib
Date: Thu, 4 Nov 2021 14:18:11 +0000	[thread overview]
Message-ID: <316386e6-8da1-a48b-cecb-82d4a9afb85c@arm.com> (raw)
In-Reply-To: <CO1PR11MB5058249DD43059FE85ADE57EC58D9@CO1PR11MB5058.namprd11.prod.outlook.com>

Hi Min,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar


On 04/11/2021 01:49 PM, Xu, Min M wrote:
> On November 4, 2021 9:35 PM, Xu Min wrote:
>> On November 4, 2021 4:21 PM, Gerd Hoffmann wrote:
>>>    Hi,
>>>
>>>> [SAMI] Apologies, I missed this in my previous review. I think the
>>>> behaviour if both the TCG2 and CC measurement protocols are
>>>> installed would be inconsistent between DxeTpmMeasurementLib and
>>>> DxeTpm2MeasureBootLib. The main difference being in the later, the
>>>> TCG2 protocol takes precedence for extending the measurement.
>>> Yes, we should have consistent behavior in both cases.
>> In DxeTpmMeasurementLib, Cc measurement protocol is used as the first try. If
>> it fails, then it try to measure with TCG2 / TCG protocol in turn.
>> In DxeTpm2MeasureBootLib, TCG2 protocol is used the as the first try. If it fails,
>> CC measurement protocol is tried in turn.
>> Yes, this is inconsistent. I will update DxeTpm2MeasureBootLib to try Cc
>> measurement protocol first, then try TCG2 protocol if Cc measurement protocol
>> fails. In this way, only one protocol will be called to do the measurement. But
>> TCG2 protocol is the first try, CC measurement protocol is the second try.
>>
>>>> I think it would be good to modify DxeTpm2MeasureBootLib so that the
>>>> CC measurement protocol is used if both protocols are installed.
>>>> What do you think?
>>> Does it makes sense to use both protocols?
>> Agree with Gerd. I don't think we should use both protocols to do the
>> measurement.
>> My suggestion is that, first try CC protocol, if it fails, then try TCG2 protocol. Just
>> as I explained above.
> Another option will be that:
> In DxeTpmMeasurementLib the pseudo would look like:
> If (CC Protocol is installed) {
>    Status = CcMeasureAndLogData (...)
> } else {  // below is the original code
>   Status = Tpm20MeasureAndLogData (...)
>   If (EFI_ERROR (Status)) {
>      Status = Tpm12MeasureAndLogData (...)
>   }
> }
>
> In DxeTpm2MeasureBootLib, the pseudo would look like:
> If (CC Protocol is installed) {
>      Status = DoCcMeasureBoot(...)
> } else if (TCG2 protocol is installed) {
>      Status = DoTcg2MeasureBoot(...)
> }
[SAMI] Your pseudo code looks good to me. It makes the measurement logic 
much clearer.
  Also, I am not aware if there is a use-case for both the CC Protocol 
and the TCG2 protocols to be installed at the same time.
[/SAMI]
> Sami & Gerd
> What's your thougth?
>
> Thanks
> Min


  reply	other threads:[~2021-11-04 14:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  2:50 [PATCH V4 0/3] Introduce CcMeasurementProtocol into EDK2 Min Xu
2021-11-02  2:50 ` [PATCH V4 1/3] MdePkg: Introduce CcMeasurementProtocol for CC Guest firmware Min Xu
2021-11-02  6:24   ` Yao, Jiewen
2021-11-02  9:41   ` Sami Mujawar
2021-11-04  5:51   ` 回复: " gaoliming
2021-11-04 12:35     ` [edk2-devel] " Min Xu
2021-11-05  5:20       ` 回复: " gaoliming
2021-11-05  6:22         ` Min Xu
2021-11-02  2:50 ` [PATCH V4 2/3] SecurityPkg: Support CcMeasurementProtocol in DxeTpm2MeasureBootLib Min Xu
2021-11-02  6:24   ` Yao, Jiewen
2021-11-03  2:59     ` Min Xu
2021-11-02  9:43   ` Sami Mujawar
2021-11-05  2:12     ` [edk2-devel] " Min Xu
2021-11-02  2:50 ` [PATCH V4 3/3] SecurityPkg: Support CcMeasurementProtocol in DxeTpmMeasurementLib Min Xu
2021-11-02  6:24   ` Yao, Jiewen
2021-11-03  3:01     ` Min Xu
2021-11-02  9:45   ` Sami Mujawar
2021-11-04  8:20     ` Gerd Hoffmann
2021-11-04 13:35       ` [edk2-devel] " Min Xu
2021-11-04 13:49         ` Min Xu
2021-11-04 14:18           ` Sami Mujawar [this message]
2021-11-04 14:25             ` Yao, Jiewen
2021-11-05  2:15     ` Min Xu

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-list 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=316386e6-8da1-a48b-cecb-82d4a9afb85c@arm.com \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox