All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Jason Gunthorpe <jgg@nvidia.com>, Mimi Zohar <zohar@linux.ibm.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v4 1/1] tpm: add sysfs exports for all banks of PCR registers
Date: Tue, 18 Aug 2020 12:03:44 -0700	[thread overview]
Message-ID: <1597777424.3898.60.camel@HansenPartnership.com> (raw)
In-Reply-To: <20200818183603.GC1152540@nvidia.com>

On Tue, 2020-08-18 at 15:36 -0300, Jason Gunthorpe wrote:
> On Tue, Aug 18, 2020 at 02:26:04PM -0400, Mimi Zohar wrote:
> > On Tue, 2020-08-18 at 13:46 -0300, Jason Gunthorpe wrote:
> > > On Tue, Aug 18, 2020 at 07:26:30PM +0300, Jarkko Sakkinen wrote:
> > > > On Tue, Aug 18, 2020 at 07:19:57PM +0300, Jarkko Sakkinen
> > > > wrote:
> > > > > On Tue, Aug 18, 2020 at 07:12:09PM +0300, Jarkko Sakkinen
> > > > > wrote:
> > > > > > On Mon, Aug 17, 2020 at 02:35:06PM -0700, James Bottomley
> > > > > > wrote:
> > > > > > > Create sysfs per hash groups with 24 PCR files in them
> > > > > > > one group, named pcr-<hash>, for each agile hash of the
> > > > > > > TPM.  The files are plugged in to a PCR read function
> > > > > > > which is TPM version agnostic, so this works also for TPM
> > > > > > > 1.2 but the hash is only sha1 in that case.
> > > > > > > 
> > > > > > > Note: the macros used to create the hashes emit spurious
> > > > > > > checkpatch warnings.  Do not try to "fix" them as
> > > > > > > checkpatch recommends, otherwise they'll break.
> > > > > > > 
> > > > > > > Signed-off-by: James Bottomley <James.Bottomley@HansenPar
> > > > > > > tnership.com>
> > > > > > > Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > > > > > Tested-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> > > > > > 
> > > > > > I have hard time understanding why this is required.
> > > > > > 
> > > > > > You can grab the information through /dev/tpm0 just fine.
> > > > > 
> > > > > I just think it is principally wrong to add sysfs files if
> > > > > they don't have any measurable value other than perhaps some
> > > > > convenience.
> > > > > 
> > > > > It is trival to write only a libc dependent program that
> > > > > outputs PCRs.
> > > > > 
> > > > > I think this is essentially an user space problem that is
> > > > > getting sorted out with kernel code.
> > > > 
> > > > Jason, what do you make of this? I recall that it was you who I
> > > > discussed with about this topic when TPM 2.0 support was first
> > > > upstreamed.
> > > 
> > > TPM 2.0 broke all the userspace so it made sense to get rid of
> > > the non-conforming sysfs files from TPM v1.x time as part of the
> > > userspace API. That was the main reason to not continue forward
> > > with PCR in userspace.
> > > 
> > > As far as doing it properly as this patch does.. I agree with you
> > > that sysfs files should have some reason to be added, espcially
> > > if it causes quite big code cost as this does. eg to drive a udev
> > > rule decision.
> > > 
> > > Why is PCRs so special it needs to be in sysfs? What is userspace
> > > going to do with this information?
> > 
> > The original IMA LTP "boot_aggregate" regression test is dependent
> > on the exported TPM event log and PCRs.  Similar support is needed
> > for TPM 2.0.  There isn't just a single userspace application for
> > reading PCRs.  As soon as we add support for one userspace
> > application,  support for the other applications is requested.  So
> > instead of a having a simple regression test with a single method
> > of reading PCRs, we're now required to support multiple userspace
> > applications.
> 
> But this test already has a C program as part of the boot aggregate
> test, why is it such a problem to use a C program to also read the
> PCRs?
> 
> As Jarkko says it is not so hard

It's not so hard for system programmer who owns the root account, like
the people who hang out on this list.  For your average user, a root
only device you're expected to send and receive binary packets of big
endian data over is a textbook definition of an unusable interface.

I can potentially buy arguments that ordinary users can get this
information from TSS based toolkits (although both the Intel and the
IBM TSS seem to go out of their way to make it hard to extract). Or
even that the average user has no use for the information (although
I've given three examples).  However, it's not realistic to expect that
the average user start speaking binary packet protocols from shell
scripts.

James


  parent reply	other threads:[~2020-08-18 19:03 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 [this message]
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
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=1597777424.3898.60.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@nvidia.com \
    --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.