From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Alexander Steffen <Alexander.Steffen@infineon.com>,
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-integrity@vger.kernel.org
Subject: Re: [PATCH] tpm: fix selftest failure regression
Date: Fri, 16 Feb 2018 11:45:37 -0800 [thread overview]
Message-ID: <1518810337.4475.16.camel@HansenPartnership.com> (raw)
In-Reply-To: <0f489217-b1f2-0265-d5d3-05f7b72d717e@infineon.com>
On Fri, 2018-02-16 at 20:26 +0100, Alexander Steffen wrote:
> On 16.02.2018 19:59, James Bottomley wrote:
> >
> > On Fri, 2018-02-16 at 10:17 -0800, James Bottomley wrote:
> > >
> > > On Fri, 2018-02-16 at 10:34 +0200, Jarkko Sakkinen wrote:
> > > >
> > > >
> > > > Hi
> > > >
> > > > See the comments below and please include this as a prequel
> > > > patch for the next version:
> > > >
> > > > https://patchwork.kernel.org/patch/10208965/
> > >
> > > Actually, I've got another curious bit of behaviour from my
> > > Nuvoton: After an experiment with primary EK generation that
> > > sent it into failure mode (connected with something else, nothing
> > > to do with this), it's taken to returning 232
> > > (TPM_RC_COMMAND_CODE) to a partial self test periodically on
> > > boot. According to the manual this is impossible, so I think
> > > it's something to do with tpm_validate_command. I think,
> > > perhaps, we shouldn't call the getcaps for the command codes
> > > until the self test is over, but I need to do more debugging to
> > > track down what's going on.
> > >
> > > I've also got other reports of TPM_RC_COMMAND_CODE failures
> > > during self test, so this isn't just my screwed up chip.
> >
> > This isn't anything to do with us synthesizing TPM_RC_COMMAND_CODE,
> > the status is definitely coming from the chip. If I run a full
> > self test immediately after this, everything works as normal.
>
> Interesting. What you call full and partial self test, those are the
> same command (TPM2_SelfTest), just with fullTest=YES and fullTest=NO,
> right? Then it seems even stranger that whether you get
> RC_COMMAND_CODE does not depend on the command but on the parameter.
Yes, I did a lot of debugging because this is unexpected, but
nevertheless that's what I see.
> > Can anyone from the manufacturers shed any light on the
> > TPM_RC_COMMAND_CODE return from a partial self test?
>
> It's the first time I see this usage of that return code. The
> specification says that this code means "command code not supported",
> which to me sounds rather like "command not implemented", not
> "command temporarily not available". Maybe this is just a bug in this
> TPM implementation?
That was my first theory. However, even if it's only Nuvoton specific
they're pretty widely deployed (all the Dell laptops), so we have to
cope with it in the kernel. But I've also got reports of the same
problem affecting a ST Micro TPM, so it looks like an implementation
that's spreading.
For those who can play along at home, the way I induce the TPM failure
is to execute
tsscreateek -cp -alg ec -noflush
What seems to be happening is that most TPM implementations have a hard
coded short cut for primary endorsement key generation, but mine seems
to be missing the EC certificate, so asking it to generate an EC
primary for the endorsement seed hits a BUG_ON() in its internal
implementation code which causes the TPM to go into failure mode.
James
next prev parent reply other threads:[~2018-02-16 19:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1518122886.21828.20.camel@HansenPartnership.com>
2018-02-15 13:55 ` [PATCH] tpm: fix selftest failure regression Jarkko Sakkinen
2018-02-16 8:34 ` Jarkko Sakkinen
2018-02-16 18:17 ` James Bottomley
2018-02-16 18:59 ` James Bottomley
2018-02-16 19:26 ` Alexander Steffen
2018-02-16 19:45 ` James Bottomley [this message]
2018-02-20 14:24 ` Jarkko Sakkinen
2018-02-20 14:33 ` James Bottomley
2018-04-08 19:11 ` Ken Goldman
2018-02-20 13:30 ` Jarkko Sakkinen
2018-02-20 13:57 ` James Bottomley
2018-02-20 17:22 ` Jarkko Sakkinen
2018-02-20 17:27 ` James Bottomley
2018-02-16 20:15 ` James Bottomley
2018-02-18 17:08 ` Jason Gunthorpe
2018-02-18 17:16 ` James Bottomley
2018-02-18 17:36 ` Jason Gunthorpe
2018-02-18 18:06 ` James Bottomley
2018-02-20 14:25 ` 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=1518810337.4475.16.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=Alexander.Steffen@infineon.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-integrity@vger.kernel.org \
/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.