From: Mimi Zohar <zohar@linux.ibm.com>
To: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: linux-integrity@vger.kernel.org, bill.c.roberts@gmail.com
Subject: Re: [PATCH v3 ima-evm-utils] extend ima_measurement --pcrs option to support per-bank pcr files
Date: Fri, 24 Jul 2020 15:44:18 -0400 [thread overview]
Message-ID: <1595619858.5017.39.camel@linux.ibm.com> (raw)
In-Reply-To: <1595617967.5017.31.camel@linux.ibm.com>
On Fri, 2020-07-24 at 15:12 -0400, Mimi Zohar wrote:
> On Fri, 2020-07-24 at 10:52 -0400, Stephen Smalley wrote:
> > Extend the ima_measurement --pcrs option to support per-bank pcr files.
> > The extended syntax is "--pcrs algorithm,pathname". If no algorithm
> > is specified, it defaults to sha1 as before. Multiple --pcrs options
> > are now supported, one per bank of PCRs. The file format remains
> > unchanged. If --pcrs is specified, only try to read PCRs from the
> > specified file(s); do not fall back to trying to read from sysfs
> > or the TPM itself in this case since the user requested use of
> > the files.
> >
> > Create per-bank pcr files, depends on "tpm: add sysfs exports for all
> > banks of PCR registers" kernel patch:
> > $ cat tpm2pcrread.sh
> > #!/bin/sh
> > for alg in sha1 sha256
> > do
> > rm -f pcr-$alg
> > pcr=0;
> > while [ $pcr -lt 24 ];
> > do
> > printf "PCR-%02d: " $pcr >> pcr-$alg;
> > cat /sys/class/tpm/tpm0/pcr-$alg/$pcr >> pcr-$alg;
> > pcr=$[$pcr+1];
> > done
> > done
> > $ sh ./tpm2pcrread.sh
> >
> > Pass only the sha1 PCRs to evmctl defaulting to sha1:
> > $ sudo evmctl ima_measurement --pcrs pcr-sha1 /sys/kernel/security/integrity/ima/binary_runtime_measurements
> >
> > Pass only the sha1 PCRs to evmctl with explicit selection of sha1:
> > $ sudo evmctl ima_measurement --pcrs sha1,pcr-sha1 /sys/kernel/security/integrity/ima/binary_runtime_measurements
> >
> > Pass both sha1 and sha256 PCRs to evmctl:
> > $ sudo evmctl ima_measurement --pcrs sha1,pcr-sha1 --pcrs sha256,pcr-sha256 /sys/kernel/security/integrity/ima/binary_runtime_measurements
> >
> > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
>
> I reviewed the patch and everything looks good, other than a few
> comments below. Weirdly the order in which the TPM bank files
> containing the PCRs are supplied on the command line is affecting
> being able to verify the measurement list - sha1, sha256 versus
> sha256, sha1. Perhaps during the time it takes to read the different
> banks, the PCRs have changed? Not quite sure what is happening.
Never mind, problem solved.
Mimi
prev parent reply other threads:[~2020-07-24 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 14:52 [PATCH v3 ima-evm-utils] extend ima_measurement --pcrs option to support per-bank pcr files Stephen Smalley
2020-07-24 19:12 ` Mimi Zohar
2020-07-24 19:44 ` Mimi Zohar [this message]
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=1595619858.5017.39.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=bill.c.roberts@gmail.com \
--cc=linux-integrity@vger.kernel.org \
--cc=stephen.smalley.work@gmail.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.