linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Xing, Cedric" <cedric.xing@intel.com>, Qinkun Bao <qinkun@google.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Samuel Ortiz <sameo@rivosinc.com>, Lukas Wunner <lukas@wunner.de>,
	Dionna Amalie Glaze <dionnaglaze@google.com>,
	Mikko Ylinen <mikko.ylinen@linux.intel.com>,
	Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev,
	suzuki.poulose@arm.com, sami.mujawar@arm.com,
	Chong Cai <chongc@google.com>
Subject: Re: [PATCH RFC 0/3] tsm: Unified Measurement Register ABI for TVMs
Date: Thu, 12 Sep 2024 08:15:01 -0400	[thread overview]
Message-ID: <0b334090c4bf21740b19371664ad0d78b66830c4.camel@HansenPartnership.com> (raw)
In-Reply-To: <c7157fb7-b8d0-482b-9ec3-d60179a95882@intel.com>

On Wed, 2024-09-11 at 22:23 -0500, Xing, Cedric wrote:
> Hi James,
> 
> I would like to clarify that, even though the log format is
> incompatible with the existing TCG2 log format, nothing prevents TPM
> PCRs from being exposed through the TSM measurement framework.

Well, the PCRs are already exposed through 

/sys/class/tpm/tpm0/pcr-<algo>/<n>

but they don't have much meaning without the log.

> Please note that the existing event types in the TCG2 log format are 
> predominantly BIOS/firmware-oriented, which seldom makes sense for 
> applications in OS runtime. Consequently, most application-specific 
> events have to come under the EV_EVENT_TAG umbrella, which is 
> essentially arbitrary binary data with no specific format. Thus, I
> don't see much value in continuing the TCG2 log into OS runtime IMHO.

And the IMA log, which is runtime and isn't TCG2?

> The proposed log format aims to provide a framework for unambiguous 
> hashing while allowing application-defined events. Its primary design
> objective is to enable application-agnostic kernel/verifier to 
> hash/verify logs without understanding the event records, allowing 
> application-specific appraisers to be built on top (i.e., 
> semantics/storage separation). Both TCG2 and CEL formats rely on 
> event/content type to dictate what part of event data to hash, making
> semantics/storage separation impossible. Therefore, this proposed log
> format cannot accommodate entries from TCG2 or CEL logs due to that 
> design conflict. However, entries of this log can easily be
> encapsulated in TCG2 (as EV_ACTION entries) or CEL-JSON (a new
> content type string needs to be defined, like what systemd is doing
> today) logs.

But that's my complaint.  This specification:

   - Records are lines ending with `\n`.
   - Each record (line) is hashed in its entirety (excluding the
   trailing `\n`) and extended to the RTMR.
   - The log for an RTMR is stored at
   `/sys/kernel/tsm/<MR group name>/<RTMR name>/event_log` and consists
   of these delineated records.
   - Lines that are empty (containing only `\n`) or start with `#` are
   skipped (not hashed or extended).
   
Is completely incompatible with pretty much every current log format. 
Given you have fairly elaborate decorations for the register formats,
what's the problem with simply having a decoration for the log format? 
That way you can use the above incompatible log for your purpose but this
framework can support existing logs and expand to future ones as they come
along.  All this would mean initially to the code is adding the decoration
file (easy) and ensuring that append_event is handled by a log format
specific component, allowing for expansion.

James


  reply	other threads:[~2024-09-12 12:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08  4:56 [PATCH RFC 0/3] tsm: Unified Measurement Register ABI for TVMs Cedric Xing
2024-09-08  4:56 ` [PATCH RFC 1/3] tsm: Add TVM Measurement Register Support Cedric Xing
2024-09-08  4:56 ` [PATCH RFC 2/3] tsm: Add RTMR event logging Cedric Xing
2024-09-08  4:56 ` [PATCH RFC 3/3] tsm: Add TVM Measurement Sample Code Cedric Xing
2024-09-09 15:14   ` Jeff Johnson
2024-09-09 15:20     ` Xing, Cedric
2024-09-12 12:28   ` James Bottomley
2024-09-14 16:36     ` Xing, Cedric
2024-09-14 17:10       ` James Bottomley
2024-09-15  4:53         ` Xing, Cedric
2024-10-24 17:21         ` Mikko Ylinen
2024-09-08 17:37 ` [PATCH RFC 0/3] tsm: Unified Measurement Register ABI for TVMs Alexander Graf
2024-09-09 14:55   ` Xing, Cedric
2024-09-10  7:47     ` Alexander Graf
2024-09-10 18:07       ` Xing, Cedric
2024-09-10 17:09 ` Jean-Philippe Brucker
2024-09-11  4:01   ` Xing, Cedric
2024-09-11  6:56     ` Alexander Graf
2024-09-12 15:43       ` Xing, Cedric
2024-09-13  9:43         ` Alexander Graf
2024-09-11 12:06     ` James Bottomley
2024-09-11 13:46       ` Qinkun Bao
2024-09-11 14:10         ` James Bottomley
2024-09-12  3:23           ` Xing, Cedric
2024-09-12 12:15             ` James Bottomley [this message]
2024-09-12 19:00               ` Xing, Cedric
2024-09-13 12:55                 ` James Bottomley
2024-09-15  4:31                   ` Xing, Cedric
2024-09-13 12:58                 ` James Bottomley
2024-09-15  5:14                   ` Xing, Cedric
2024-09-11 23:29       ` Dan Williams
2024-09-11 23:36     ` Dan Williams
2024-09-12  9:25     ` Jean-Philippe Brucker
2024-09-12 10:03   ` Christophe de Dinechin
2024-09-12 11:02     ` Jean-Philippe Brucker
2024-09-13 19:42     ` Xing, Cedric

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=0b334090c4bf21740b19371664ad0d78b66830c4.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=cedric.xing@intel.com \
    --cc=chongc@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dionnaglaze@google.com \
    --cc=jean-philippe@linaro.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mikko.ylinen@linux.intel.com \
    --cc=qinkun@google.com \
    --cc=sameo@rivosinc.com \
    --cc=sami.mujawar@arm.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=suzuki.poulose@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).