All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>,
	"Petr Vorel" <pvorel@suse.cz>, Nayna <nayna@linux.vnet.ibm.com>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	linux-integrity <linux-integrity@vger.kernel.org>,
	ltp@lists.linux.it, "Piotr Król" <piotr.krol@3mdeb.com>,
	"Peter Huewe" <peterhuewe@gmx.de>
Subject: Re: [LTP] [PATCH] ima: skip verifying TPM 2.0 PCR values
Date: Thu, 24 Oct 2019 20:26:46 -0300	[thread overview]
Message-ID: <20191024232646.GE23952@ziepe.ca> (raw)
In-Reply-To: <20191024213842.c6cl4tlnsi56pgcy@cantor>

On Thu, Oct 24, 2019 at 02:38:42PM -0700, Jerry Snitselaar wrote:
> On Thu Oct 24 19, Jarkko Sakkinen wrote:
> > On Thu, Oct 24, 2019 at 02:18:48PM +0200, Petr Vorel wrote:
> > > Hi all,
> > > 
> > > I wonder what to do with this patch "ima: skip verifying TPM 2.0 PCR values" [1].
> > > Is it a correct way to differentiate between TPM 1.2 and TPM 2.0?
> > > Or something else should be applied?
> > > 
> > > How is the work on TPM 2.0 Linux sysfs interface?
> > > But even it's done in near future, we'd still need some way for older kernels.
> > > 
> > > Kind regards,
> > > Petr
> > > 
> > > [1] https://patchwork.ozlabs.org/patch/1100733/
> > 
> > version_major sysfs file would be acceptable if someone wants to proceed
> > and send such patch.
> > 
> > Also replicants for durations and timeouts files would make sense for
> > TPM 2.0.
> > 
> > /Jarkko
> 
> Is it as simple as doing this?
> 
> diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
> index edfa89160010..fd8eb8d8945c 100644
> +++ b/drivers/char/tpm/tpm-sysfs.c
> @@ -309,7 +309,17 @@ static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr,
> }
> static DEVICE_ATTR_RO(timeouts);
> 
> -static struct attribute *tpm_dev_attrs[] = {
> +static ssize_t version_major_show(struct device *dev,
> +                                 struct device_attribute *attr, char *buf)
> +{
> +       struct tpm_chip *chip = to_tpm_chip(dev);

> +       return sprintf(buf, "TPM%s\n", chip->flags & TPM_CHIP_FLAG_TPM2
> +                      ? "2.0" : "1.2");

Probably no TPM prefix here

The usual sysfs naming would be more like 'major_version'

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@ziepe.ca>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] ima: skip verifying TPM 2.0 PCR values
Date: Thu, 24 Oct 2019 20:26:46 -0300	[thread overview]
Message-ID: <20191024232646.GE23952@ziepe.ca> (raw)
In-Reply-To: <20191024213842.c6cl4tlnsi56pgcy@cantor>

On Thu, Oct 24, 2019 at 02:38:42PM -0700, Jerry Snitselaar wrote:
> On Thu Oct 24 19, Jarkko Sakkinen wrote:
> > On Thu, Oct 24, 2019 at 02:18:48PM +0200, Petr Vorel wrote:
> > > Hi all,
> > > 
> > > I wonder what to do with this patch "ima: skip verifying TPM 2.0 PCR values" [1].
> > > Is it a correct way to differentiate between TPM 1.2 and TPM 2.0?
> > > Or something else should be applied?
> > > 
> > > How is the work on TPM 2.0 Linux sysfs interface?
> > > But even it's done in near future, we'd still need some way for older kernels.
> > > 
> > > Kind regards,
> > > Petr
> > > 
> > > [1] https://patchwork.ozlabs.org/patch/1100733/
> > 
> > version_major sysfs file would be acceptable if someone wants to proceed
> > and send such patch.
> > 
> > Also replicants for durations and timeouts files would make sense for
> > TPM 2.0.
> > 
> > /Jarkko
> 
> Is it as simple as doing this?
> 
> diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
> index edfa89160010..fd8eb8d8945c 100644
> +++ b/drivers/char/tpm/tpm-sysfs.c
> @@ -309,7 +309,17 @@ static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr,
> }
> static DEVICE_ATTR_RO(timeouts);
> 
> -static struct attribute *tpm_dev_attrs[] = {
> +static ssize_t version_major_show(struct device *dev,
> +                                 struct device_attribute *attr, char *buf)
> +{
> +       struct tpm_chip *chip = to_tpm_chip(dev);

> +       return sprintf(buf, "TPM%s\n", chip->flags & TPM_CHIP_FLAG_TPM2
> +                      ? "2.0" : "1.2");

Probably no TPM prefix here

The usual sysfs naming would be more like 'major_version'

Jason

  reply	other threads:[~2019-10-24 23:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 21:12 [PATCH] ima: skip verifying TPM 2.0 PCR values Mimi Zohar
2019-05-16 21:12 ` [LTP] " Mimi Zohar
2019-05-17  6:51 ` Petr Vorel
2019-05-17  6:51   ` [LTP] " Petr Vorel
2019-05-17 11:19   ` Mimi Zohar
2019-05-17 11:19     ` [LTP] " Mimi Zohar
2019-05-17 11:28     ` Petr Vorel
2019-05-17 11:28       ` [LTP] " Petr Vorel
2019-05-17 13:50 ` Nayna
2019-05-17 13:50   ` [LTP] " Nayna
2019-05-17 15:04   ` Petr Vorel
2019-05-17 15:04     ` [LTP] " Petr Vorel
2019-10-24 12:18     ` Petr Vorel
2019-10-24 12:18       ` Petr Vorel
2019-10-24 17:20       ` Jarkko Sakkinen
2019-10-24 17:20         ` Jarkko Sakkinen
2019-10-24 18:20         ` Jason Gunthorpe
2019-10-24 18:20           ` Jason Gunthorpe
2019-10-24 19:14           ` Jarkko Sakkinen
2019-10-24 19:14             ` Jarkko Sakkinen
2019-10-24 23:36             ` Jason Gunthorpe
2019-10-24 23:36               ` Jason Gunthorpe
2019-10-28 20:51               ` Jarkko Sakkinen
2019-10-28 20:51                 ` Jarkko Sakkinen
2019-10-24 21:38         ` Jerry Snitselaar
2019-10-24 21:38           ` Jerry Snitselaar
2019-10-24 23:26           ` Jason Gunthorpe [this message]
2019-10-24 23:26             ` Jason Gunthorpe
2019-10-25  0:47           ` Mimi Zohar
2019-10-25  0:47             ` Mimi Zohar
2019-10-25  2:11             ` Jerry Snitselaar
2019-10-25  2:11               ` Jerry Snitselaar
2019-10-25  8:56               ` Petr Vorel
2019-10-25  8:56                 ` Petr Vorel
2019-10-25 12:52                 ` Serge E. Hallyn
2019-10-25 12:52                   ` Serge E. Hallyn
2019-10-25 13:22                   ` Mimi Zohar
2019-10-25 13:22                     ` Mimi Zohar
2019-10-25 13:25                   ` Petr Vorel
2019-10-25 13:25                     ` Petr Vorel
2019-10-25 14:13                 ` Jerry Snitselaar
2019-10-25 14:13                   ` Jerry Snitselaar

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=20191024232646.GE23952@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=nayna@linux.vnet.ibm.com \
    --cc=peterhuewe@gmx.de \
    --cc=piotr.krol@3mdeb.com \
    --cc=pvorel@suse.cz \
    --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.