linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: linux-integrity@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v5 0/1] add sysfs exports for TPM 2 PCR registers
Date: Wed, 13 Jan 2021 22:48:41 +0200	[thread overview]
Message-ID: <X/9cqbUN263oR8gZ@linux.intel.com> (raw)
In-Reply-To: <20210113015958.6685-1-James.Bottomley@HansenPartnership.com>

On Tue, Jan 12, 2021 at 05:59:57PM -0800, James Bottomley wrote:
> This represents v5 which has the spelling mistake fixed and the WARN
> on unrecognized TPM hash algorithm becoming a dev_err.
> 
> We've had a fairly extensive discussion and iterated to agreement on
> the output format, which becomes our ABI being one single compact hex
> representation of the hash value per file according to sysfs rules,
> with the file hierarchy going under
> 
>   /sys/class/tpm/tmp<x>/pcr-<hash>/<pcr number>
> 
> So to get the value of PCR 7 in the sha256 bank of the default TPM I'd do
> 
>    cat /sys/class/tpm/tpm0/pcr-sha256/7
>    2ED93F199692DC6788EFA6A1FE74514AB9760B2A6CEEAEF6C808C13E4ABB0D42
> 
> If you need the binary hash of a set of PCRs, as is required for TPM
> policy statements that lock to PCRs, you'd use something like:
> 
>   cat /sys/class/tpm/tpm0/pcr-sha256/{1,6,7}|xxd -r -p|sha256sum
> 
> Which produces the binary hash of PCRs 1, 6 and 7 in that order.
> 
> Note that this patch also adds the sha1 bank for TPM 1.2 in the same
> manner (one file per PCR) but does not remove the existing pcrs file
> which has the space separated all PCRs in one file format of
> 
>   PCR-00: 7D 29 CB 08 0C 0F C4 16 7A 0E 9A F7 C6 D3 97 CD C1 21 A7 69 
>   PCR-01: 9C B6 79 4C E4 4B 62 97 4C AB 55 13 1A 2F 7E AE 09 B3 30 BE 
>   ...
> 
> 
> James
> 
> ---
> 
> James Bottomley (1):
>   tpm: add sysfs exports for all banks of PCR registers
> 
>  drivers/char/tpm/tpm-sysfs.c | 179 +++++++++++++++++++++++++++++++++++
>  include/linux/tpm.h          |   9 +-
>  2 files changed, 187 insertions(+), 1 deletion(-)
> 
> -- 
> 2.26.2
> 

After clearing out Greg's remarks, can you use jarkko@kernel.org
for the next version?

/Jarkko

  parent reply	other threads:[~2021-01-13 20:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  1:59 [PATCH v5 0/1] add sysfs exports for TPM 2 PCR registers James Bottomley
2021-01-13  1:59 ` [PATCH v5 1/1] tpm: add sysfs exports for all banks of " James Bottomley
2021-01-13  7:48   ` Greg KH
2021-01-13 17:31     ` James Bottomley
2021-01-13 22:14       ` Jarkko Sakkinen
2021-01-14  2:55         ` James Bottomley
2021-01-13  7:50   ` Greg KH
2021-01-15 18:04     ` James Bottomley
2021-01-13 20:48 ` Jarkko Sakkinen [this message]
2021-01-13 21:02   ` [PATCH v5 0/1] add sysfs exports for TPM 2 " James Bottomley

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=X/9cqbUN263oR8gZ@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=linux-api@vger.kernel.org \
    --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 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).