linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "David R. Bild" <david.bild@xaptum.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	philip.b.tricca@intel.com, Jason Gunthorpe <jgg@ziepe.ca>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter Huewe <peterhuewe@gmx.de>,
	linux-usb@vger.kernel.org, linux-integrity@vger.kernel.org
Subject: Re: [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM
Date: Thu, 10 May 2018 07:47:32 -0700	[thread overview]
Message-ID: <1525963652.3258.4.camel@HansenPartnership.com> (raw)
In-Reply-To: <CAAi9uDsLmW3K=1UYsmJKOc6hsXqcJXFHyO_scMan5u8d94D9=Q@mail.gmail.com>

On Thu, 2018-05-10 at 09:25 -0500, David R. Bild wrote:
> On Tue, May 8, 2018 at 10:36 AM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > 
> > On Tue, 2018-05-08 at 10:29 -0500, David R. Bild wrote:
> > > On Tue, May 8, 2018 at 10:25 AM, James Bottomley
> > > <James.Bottomley@hansenpartnership.com> wrote:
> > > > 
> > > > I don't see any reason to set an unreachable password for the
> > > > platform hierarchy if the UEFI didn't.  If the desire is to
> > > > disable the platform hierarchy, then it should be disabled, not
> > > > have a random password set.
> > > 
> > > "Set random password and throw away the key" was my way of
> > > disabling the platform hierarchy.  Is there a better way of doing
> > > that?
> > 
> > Well, yes, use TPM2_HierarchyControl to set phEnable to CLEAR.
> 
> 
> I'm not sure that will work for us.  Let me give a little more detail
> about this card.
> 
> The TPM holds access credentials for connecting to the Xaptum
> network. This approach enables secure, zero-touch provisioning for
> IoT devices:  Xaptum pre-provisions the TPMs *before* they are
> assembled onto a device PCB. The device is shipped directly from
> factory to end customer. The first time it turns on, the TPM is used
> to authenticate the Xaptum network. Using a TPM protects the
> credentials from being copied or duplicated by someone in the
> manufacturing chain.

OK, so these are effectively DevId keys.  However, what makes you think
knowing the platform auth allows you to duplicate the keys?  As long as
you created them correctly (as in without duplication authority) then
even knowing the platform authorization I can't get them out of your
TPM.

> These cards are designed for existing devices, like IoT gateways. You
> can't add a TPM to an existing PCB, but you can plug in a mini PCI-e
> card.
> 
> We provision the credentials (the DAA secret key, specifically) under
> the platform hierarchy. The key can be used without platform
> authorization, but not removed.  If we disable the platform hierarchy
> entirely, I think the credentials will no longer be available for
> use.

That's certainly true if you actually need to use the platform
hierarchy.  Your initial emails on the subject did say you were
disabling it though ...

> > > > I'd also say this is probably the job of early boot based on
> > > > policy.
> > > 
> > > Agreed.  And since this card has no "early boot", the
> > > driver/kernel need to do it.
> > 
> > Early boot means userspace. for a hot pluggable device, this would
> > probably be something in udev if you follow the no-daemon model and
> > the daemon could do it if you do follow the daemon model.
> 
> Could you expand on the udev approach?  I might not understand enough
> about udev (or the coming TPM resource manager changes) to follow the
> suggestion.
> 
> This seems unsafe to me.  There's a race between a malicious
> userspace program and the daemon to set the platform
> authorization.  If the malicious program wins, it can reset the TPM,
> removing the credentials, and the device won't be able to connect to
> the Xaptum network. (This is a liveness concern, not safety.  A
> denial-of-service attack, essentially.)

OK, I'm getting confused by your threat model.  I don't think knowing
the platform auth I can obtain your keys.  However, I agree, I can
definitely remove them.  However, setting platform auth doesn't solve
this: I can execute a TPM2_Clear to regain the platform auth and if you
disable this, I can't re-own the TPM at all.

James

  reply	other threads:[~2018-05-10 14:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180430125418.31344-1-david.bild@xaptum.com>
2018-05-04 13:00 ` [PATCH v3 0/2] Add driver for Xaptum ENF Access card (XAP-EA-00x) David R. Bild
2018-05-04 13:00 ` [PATCH v3 1/2] usb: misc: xapea00x: add driver for Xaptum ENF Access Card David R. Bild
2018-05-07  9:58   ` Oliver Neukum
2018-05-07 13:31     ` David R. Bild
2018-05-08  9:09       ` Oliver Neukum
2018-05-04 13:00 ` [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM David R. Bild
2018-05-04 19:06   ` Jason Gunthorpe
2018-05-04 19:56     ` David R. Bild
2018-05-04 20:19       ` David R. Bild
2018-05-06 15:02         ` Jason Gunthorpe
2018-05-10  1:42           ` Jarkko Sakkinen
2018-05-08 10:55       ` Jarkko Sakkinen
2018-05-08 15:25         ` James Bottomley
2018-05-08 15:29           ` David R. Bild
2018-05-08 15:36             ` James Bottomley
2018-05-10  1:59               ` Jarkko Sakkinen
2018-05-10 14:31                 ` David R. Bild
2018-05-13  8:51                   ` Jarkko Sakkinen
2018-05-25 20:31                   ` Ken Goldman
2018-05-10 14:25               ` David R. Bild
2018-05-10 14:47                 ` James Bottomley [this message]
2018-05-10 15:17                   ` David R. Bild
2018-05-25 20:23               ` Ken Goldman
2018-05-10  1:44             ` Jarkko Sakkinen
2018-05-10 14:29               ` David R. Bild
2018-05-10  1:42           ` Jarkko Sakkinen
2018-05-10 14:41         ` David R. Bild
2018-05-13  8:46           ` Jarkko Sakkinen
2018-05-14 19:31           ` Jason Gunthorpe
2018-05-14 19:59             ` David R. Bild
2018-05-14 20:08               ` Jason Gunthorpe
2018-05-14 20:12                 ` David R. Bild
2018-05-07 14:12   ` EXTERNAL: " Jeremy Boone
2018-05-08 10:47   ` Jarkko Sakkinen
2018-05-10 14:09     ` David R. Bild

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=1525963652.3258.4.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=david.bild@xaptum.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=philip.b.tricca@intel.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).