linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: linux-integrity@vger.kernel.org,
	Jerry Snitselaar <jsnitsel@redhat.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Sumit Garg <sumit.garg@linaro.org>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: Detach page allocation from tpm_buf
Date: Thu, 3 Oct 2019 21:31:01 +0300	[thread overview]
Message-ID: <20191003182934.GB20683@linux.intel.com> (raw)
In-Reply-To: <1570106350.4421.166.camel@linux.ibm.com>

On Thu, Oct 03, 2019 at 08:39:10AM -0400, Mimi Zohar wrote:
> On Thu, 2019-10-03 at 14:32 +0300, Jarkko Sakkinen wrote:
> > On Wed, Oct 02, 2019 at 08:40:24AM -0400, Mimi Zohar wrote:
> > > On Thu, 2019-09-26 at 16:12 +0300, Jarkko Sakkinen wrote:
> > > > On Thu, Sep 26, 2019 at 03:46:35PM +0300, Jarkko Sakkinen wrote:
> > > > > On Wed, Sep 25, 2019 at 04:48:41PM +0300, Jarkko Sakkinen wrote:
> > > > > > -		tpm_buf_reset(&buf, TPM2_ST_NO_SESSIONS, TPM2_CC_GET_RANDOM);
> > > > > > +		tpm_buf_reset(&buf, data_ptr, PAGE_SIZE,
> > > > > > +			      TPM2_ST_NO_SESSIONS, TPM2_CC_PCR_EXTEND);
> > > > > 
> > > > > Oops.
> > > > 
> > > > Maybe we could use random as the probe for TPM version since we anyway
> > > > send a TPM command as a probe for TPM version:
> > > > 
> > > > 1. Try TPM2 get random.
> > > > 2. If fail, try TPM1 get random.
> > > > 3. Output random number to klog.
> > > > 
> > > > Something like 8 bytes would be sufficient. This would make sure that
> > > > no new change breaks tpm_get_random() and also this would give some
> > > > feedback that TPM is at least somewhat working.
> > > 
> > > That involves sending 2 TPM commands.  At what point does this occur?
> > >  On registration?  Whenever getting a random number?  Is the result
> > > cached in chip->flags?
> > 
> > On registeration. It is just printed to klog.
> 
> What sets "TPM_CHIP_FLAG_TPM2" in chip->flags?  And when?
> 
> > 
> > > Will this delay the TPM initialization, causing IMA to go into "TPM
> > > bypass mode"?
> > 
> > Of course it will delay the init.
> 
> Delaying the init will most likely cause regressions on systems with
> TPM 1.2 systems.
> 
> Instead of sending the TPM 2.0 command and on failure sending the TPM
> 1.2 version of the command, could chip->flags be tested?  And if not
> chip->flags, then provide the TPM version as part of registration.

No rush pushing this forward. I got your point.

> > As I've stated before the real fix for the bypass issue would be
> > to make TPM as part of the core but this has not received much
> > appeal. I think I've sent patch for this once.
> 
> I must have missed this discussion.

Yeah, I think that'd be a great idea. We need a better control on
TPM core as multiple subsystem's depend on it in API level. Something
to reconsider in future.

/Jarkko

  reply	other threads:[~2019-10-03 18:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 13:48 Jarkko Sakkinen
2019-09-25 14:03 ` James Bottomley
2019-09-27 13:06   ` Jarkko Sakkinen
2019-10-02 12:41     ` Mimi Zohar
2019-10-03 11:35       ` Jarkko Sakkinen
2019-10-03 12:50         ` Mimi Zohar
2019-10-03 18:26           ` Jarkko Sakkinen
2019-09-26 12:46 ` Jarkko Sakkinen
2019-09-26 13:12   ` Jarkko Sakkinen
2019-10-02 12:40     ` Mimi Zohar
2019-10-03 11:32       ` Jarkko Sakkinen
2019-10-03 11:33         ` Jarkko Sakkinen
2019-10-03 15:24           ` Mimi Zohar
2019-10-03 18:33             ` Jarkko Sakkinen
2019-10-03 12:39         ` Mimi Zohar
2019-10-03 18:31           ` Jarkko Sakkinen [this message]
2019-09-26 17:23 Jarkko Sakkinen
2019-09-27 15:42 ` Jarkko Sakkinen
2019-09-28  7:58 ` Jerry Snitselaar
2019-10-01 20:51   ` 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=20191003182934.GB20683@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=sumit.garg@linaro.org \
    --cc=zohar@linux.ibm.com \
    --subject='Re: [PATCH] tpm: Detach page allocation from tpm_buf' \
    /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

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).