From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Greg KH <greg@kroah.com>
Cc: linux-integrity@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>,
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
linux-api@vger.kernel.org
Subject: Re: [PATCH v5 1/1] tpm: add sysfs exports for all banks of PCR registers
Date: Wed, 13 Jan 2021 09:31:44 -0800 [thread overview]
Message-ID: <a6bdeef73f9271cca99585d3e855681cf6b6f589.camel@HansenPartnership.com> (raw)
In-Reply-To: <X/6lyuhqQ8TSXOSa@kroah.com>
On Wed, 2021-01-13 at 08:48 +0100, Greg KH wrote:
> On Tue, Jan 12, 2021 at 05:59:58PM -0800, 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@HansenPartnership.com>
> > Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > Tested-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> >
> > ---
> >
> > v2: fix TPM 1.2 legacy links failure
> > v3: fix warn on and add note to tpm_algorithms
> > v4: reword commit and add tested-by
> > v5: algorithm spelling fix WARN->dev_err
> > ---
> > drivers/char/tpm/tpm-sysfs.c | 179
> > +++++++++++++++++++++++++++++++++++
> > include/linux/tpm.h | 9 +-
> > 2 files changed, 187 insertions(+), 1 deletion(-)
>
> You add new sysfs files, but do not add Documentation/ABI/ entries
> showing how they are used and what they contain :(
>
> Please do that for the next version of this patch.
It's a bit of a chicken and egg problem since I've no idea when this
will go upstream and the entries require that information making the
ABI more of a post accept type thing. I can make a guess about the
values if Jarkko is going to but this in for the next merge window.
James
---8>8>8><8<8<8---
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] ABI: add sysfs description for tpm exports of PCR registers
Adds the ABI entries for the new
/sys/class/tpm/tpm<n>/pcr-<hash>/<m>
files which are added to export the PCR hash values on a one value per
file basis.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
Documentation/ABI/stable/sysfs-class-tpm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/ABI/stable/sysfs-class-tpm b/Documentation/ABI/stable/sysfs-class-tpm
index 91ca63ec7581..d897ecb9615f 100644
--- a/Documentation/ABI/stable/sysfs-class-tpm
+++ b/Documentation/ABI/stable/sysfs-class-tpm
@@ -194,3 +194,17 @@ Description: The "tpm_version_major" property shows the TCG spec major version
Example output::
2
+
+What: /sys/class/tpm/tpmX/pcr-H/N
+Date: March 2021
+KernelVersion: 5.12
+Contact: linux-integrity@vger.kernel.org
+Description: produces output in compact hex representation for PCR
+ number N from hash bank H. N is the numeric value of
+ the PCR number and H is the crypto string
+ representation of the hash
+
+ Example output::
+
+ cat /sys/class/tpm/tpm0/pcr-sha256/7
+ 2ED93F199692DC6788EFA6A1FE74514AB9760B2A6CEEAEF6C808C13E4ABB0D42
next prev parent reply other threads:[~2021-01-13 17:32 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 [this message]
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 ` [PATCH v5 0/1] add sysfs exports for TPM 2 " Jarkko Sakkinen
2021-01-13 21:02 ` 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=a6bdeef73f9271cca99585d3e855681cf6b6f589.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=greg@kroah.com \
--cc=jarkko.sakkinen@linux.intel.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).