All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	linux-integrity@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>
Subject: Re: [PATCH v4 1/1] tpm: add sysfs exports for all banks of PCR registers
Date: Thu, 20 Aug 2020 18:22:34 +0300	[thread overview]
Message-ID: <20200820152234.GA5462@linux.intel.com> (raw)
In-Reply-To: <1597877175.4030.17.camel@HansenPartnership.com>

On Wed, Aug 19, 2020 at 03:46:15PM -0700, James Bottomley wrote:
> On Thu, 2020-08-20 at 00:53 +0300, Jarkko Sakkinen wrote:
> > > On Tue, 2020-08-18 at 14:17 -0300, Jason Gunthorpe wrote:
> > > > On Tue, Aug 18, 2020 at 09:44:30AM -0700, James Bottomley wrote:
> > > > 
> > > > > The question you should be asking isn't whether the information
> > > > > *could* be obtained by other means, but whether providing it in
> > > > > this form facilitates current operations and whether the
> > > > > interface would have users.
> > > > 
> > > > Sure. What are the use cases that need PCRs but no other TPM
> > > > operations?
> > > > 
> > > > The cover letter didn't say. As PCR is really only useful in the
> > > > context of the local TPM I'm not thinking of anything..
> > > 
> > > The three use cases I picked up at the Boot and Security MC were:
> > > 
> > >    1. local log verification: a script can run through the IMA
> > > ascii log
> > >       and construct the PCR 10 hash which can then be verified
> > >    2. Knowing what the PCR values actually are for sealed
> > > keys.  With the
> > >       current trusted key infrastructure you have to calculate and
> > > supply
> > >       the hash yourself.  With the new proposed infrastructure, the
> > > hash
> > >       would be calculated by the seal operation, but you're still
> > > going to
> > >       need the actual PCR values to debug unseal failures.
> > >    3. As a stability check for log shipping: you read the PCR take
> > > the log
> > >       then read the PCR: if the two reads are the same the PCR
> > > backing the
> > >       log is stable for quoting.
> > > 
> > > James
> > 
> > The proposed sysfs attributes are racy in the sense that PCRs could
> > change in-between reading different hashes.
> 
> That's not really a problem, is it?  For use case 2. we expect them to
> be stable otherwise you're doing the wrong thing sealing to them. For
> the IMA PCR you use the stability protocol in 3.
> 
> > A blob containing all the hashes would make more sense as it does not
> > have this issue.
> 
> It doesn't really buy anything though.  If you're verifying the log you
> always have the problem that the PCR and the log are at different
> points, so you follow the protocol in 3. or read PCR then log and
> unwind the log until it matches or you've gone too far.
> 
> > If this is for scripts to further process, it is also more efficient
> > than printable ASCII text.
> 
> I'm not fundamentally opposed to binary attributes, but realistically
> if I want the hash of PCRs 1 4 and 6 it's not fundamentally different
> to me whether I do
> 
> cat /sys/class/tpm/tpm0/pcr-sha256/1 /sys/class/tpm/tpm0/pcr-sha256/4 /sys/class/tpm/tpm0/pcr-sha256/6|sha256sum
> 
> or
> 
> cat /sys/class/tpm/tpm0/pcr-sha256/1 /sys/class/tpm/tpm0/pcr-sha256/4 /sys/class/tpm/tpm0/pcr-sha256/6|xxd -r -p|sha256sum
> 
> The point being the tool to convert the hex output back to binary
> already exists and is well known ... and binary attributes have nasty
> console properties if you accidentally cat them directly.
> 
> James

This does not look like a kind of framework of things that we want
to maintain. Especially given that it is easy to get all the data
through /dev/tpm0 easily. It is an enormous addition to uapi with
a questionable value.

/Jarkko

  reply	other threads:[~2020-08-20 15:22 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 21:35 [PATCH v4 0/1] add sysfs exports for TPM 2 PCR registers James Bottomley
2020-08-17 21:35 ` [PATCH v4 1/1] tpm: add sysfs exports for all banks of " James Bottomley
2020-08-18 16:12   ` Jarkko Sakkinen
2020-08-18 16:19     ` Jarkko Sakkinen
2020-08-18 16:26       ` Jarkko Sakkinen
2020-08-18 16:46         ` Jason Gunthorpe
2020-08-18 18:26           ` Mimi Zohar
2020-08-18 18:36             ` Jason Gunthorpe
2020-08-18 18:55               ` Mimi Zohar
2020-08-19 12:02                 ` Jason Gunthorpe
2020-08-19 13:27                   ` Mimi Zohar
2020-08-19 14:09                     ` Jason Gunthorpe
2020-08-19 14:53                       ` Mimi Zohar
2020-08-19 14:55                         ` Mimi Zohar
2020-08-19 22:16                         ` Jarkko Sakkinen
2020-08-19 22:48                           ` Jerry Snitselaar
2020-08-19 23:26                             ` Jason Gunthorpe
2020-08-20 15:46                             ` Jarkko Sakkinen
2020-08-19 14:56                       ` Serge E. Hallyn
2020-08-19 22:15                     ` Jarkko Sakkinen
2020-08-19 15:17                   ` James Bottomley
2020-08-19 16:18                     ` Jason Gunthorpe
2020-08-19 16:57                       ` Mimi Zohar
2020-08-19 17:17                         ` Jason Gunthorpe
2020-08-19 20:09                           ` James Bottomley
2020-08-19 23:21                             ` Jason Gunthorpe
2020-08-20 16:14                               ` James Bottomley
2020-08-20 16:55                                 ` Serge E. Hallyn
2020-08-21 17:41                                 ` Jarkko Sakkinen
2020-08-21 19:38                                 ` Jason Gunthorpe
2020-08-24 19:44                                   ` Jarkko Sakkinen
2020-08-24 20:20                                     ` James Bottomley
2020-08-25 15:27                                       ` Jarkko Sakkinen
2020-08-25 15:33                                         ` James Bottomley
2020-08-26 13:15                                           ` Jarkko Sakkinen
2020-08-26 13:19                                             ` Jarkko Sakkinen
2020-08-24 21:57                                     ` Jason Gunthorpe
2020-08-19 22:14                 ` Jarkko Sakkinen
2020-08-18 19:03               ` James Bottomley
2020-08-19 22:13               ` Jarkko Sakkinen
2020-08-19 22:01             ` Jarkko Sakkinen
2020-08-18 16:44       ` James Bottomley
2020-08-18 17:17         ` Jason Gunthorpe
2020-08-18 18:49           ` James Bottomley
2020-08-19 21:53             ` Jarkko Sakkinen
2020-08-19 22:46               ` James Bottomley
2020-08-20 15:22                 ` Jarkko Sakkinen [this message]
2020-08-19 21:33         ` Jarkko Sakkinen
2020-09-14 17:41   ` Jarkko Sakkinen
2020-09-14 19:19     ` James Bottomley
2020-09-15 11:22       ` Jarkko Sakkinen
2020-10-08 11:45   ` Petr Vorel
2020-10-08 14:29     ` James Bottomley
2020-10-09 16:12     ` Jarkko Sakkinen

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=20200820152234.GA5462@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=zohar@linux.ibm.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.