linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Boone <jeremy.boone@nccgroup.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"linux-security-module@vger.kernel.org" 
	<linux-security-module@vger.kernel.org>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	"monty.wiseman@ge.com" <monty.wiseman@ge.com>,
	Monty Wiseman <montywiseman32@gmail.com>,
	"Matthew Garrett" <mjg59@google.com>
Subject: Re: EXTERNAL: Re: Documenting the proposal for TPM 2.0 security in the face of bus interposer attacks
Date: Wed, 21 Nov 2018 02:24:18 +0000	[thread overview]
Message-ID: <01A99B24-E772-489C-A33F-2F3CC80281FA@nccgroup.com> (raw)
In-Reply-To: <20181120233904.GF22023@ziepe.ca>

[-- Attachment #1: Type: text/plain, Size: 5979 bytes --]



> On Nov 20, 2018, at 6:39 PM, Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 
>> On Tue, Nov 20, 2018 at 02:34:52PM -0800, James Bottomley wrote:
>> 
>> https://protect-eu.mimecast.com/s/D_7bCj2BliYEYn0TWDV1q
> 
> Notice none of their examples include 'prevent tampering with the
> hardware' all are focused on pure software attacks, which the TPM is
> excellent at preventing. The TPM was never supposed to prevent
> physical attacks against the HW for the PCR feature.
> 
> The only HW guarentee it ever provided is to prevent theft of the
> private secrets, even with physical access.
> 
>>> It doesn't need contact with the CPU. The basic flow would be to use
>>> the interposer on SPI or LPC to block the Nth PCR update, having
>>> determined that Nth comes from the BIOS and covers the
>>> bootloader.. The BIOS ignores the error, or can't tell the PCR update
>>> was corrupted. From there it is easy to see how to get into a hostile
>>> kernel and extend the PCRs to match a trusted kernel.
>> 
>> Right, but that's why I want to detect the error and shut down the TPM.
> 
> Well, I think this is a lot of industry effort and still leaves open
> other fairly simple physical attacks, like wire-to-the-reset.
> 
> I can always make an interposer that did wire-to-the-reset, I don't
> need to do complicated dynamic things with PCR extend commands.
> 
> And the null key doesn't really protect against wire-to-the-reset, as
> the null key doesn't participate in the PCR extend. So
> unseal/seal/attest commands don't know if the TPM was booted
> authentically or via a wire-to-the-reset and a hostile kernel.
> 
> Yes, it lets a trusted kernel detect a problem, but a threat model
> that includes an interposer and excludes a hostile kernel doesn't
> sound so interesting to me???

The idea is that if the bootloader(s) also protect the bus transactions with an HMAC, then we could detect tampering and before ever booting into a hostile kernel.

> 
> Like I said at the start, the way the spec is written, PCR requires
> trusted HW. Without a TPM spec change we can't fix this basic
> assumption.
> 
> A better mitigation to the interposer threat is for PCB manufactures
> to use BGA packages, blind vias and internal traces to physically deny
> easy access to the TPM bus and reset signal.

Yes. I said as much in the TPM Genie paper. A firmware TPM is even better, as we never need to worry about protecting the bus because it is never exposed in the first place. 

> 
> The last TPM project I worked on took physical security into account
> when designing the PCB and TPM chip placement, others should do the
> same :)
> 
> Jason
> 

I think it’s worth recognizing that TPMs are used in a variety of deployments, each with their own unique threat model and attack surface. 

For example, some users may care about evil maid scenarios. Heck, TPM-TOTP (and dare I mention the Qubes Anti-Evil Maid technology) utilizes the TPM to attest the boot state to the device owner. 

Other users may care about the “lost in the back of a taxi” scenario wherein the attacker may have extended physical access to the mobile device (a phone or laptop) before returning it to the owner. 

In other scenarios, the device user may be a different entity than the device owner, and as such, different security considerations must be applied. Think of a set top box that you’ve rented from your cable service provider which uses a TPM to remotely attest the firmware before being trusted to handle content decryption keys. Or a car share program that uses the TPM as a means to store temporary keyless-entry tokens — After all, the TCG Automotive Thin Profile is taking off, as are the SAE J3101 requirements which suggest the use of TPM in automotive applications.  An interposer, or even a simple sniffer attached to test points on the bus, would be able to observe any secrets transmitted between the TPM and host. 

I believe that the Linux kernel has an obligation to build in active defences that protect TPM users against serial bus attacks, and makes no blind assumptions about the ways in which a TPM may be used or deployed in a variety of creative or unexpected ways. 

This is especially true in light of the fact that the TCG (and TPM chip manufacturers as well) have not plainly documented that, despite having expended considerable effort defending against invasive silicon attacks (see Chris Tarnovsky’s work), a trivial interposer can still defeat TPM security. I believe that many do not understand this fact, and conflate the idea that measured boot can detect “hardware tampering” vs. mere “firmware tampering”. Regardless, it seems odd to me that we wish to defend against one-off attacks involving an electron microscope, but do not wish to defend against a simple microcontroller acting as a man-in-the-middle on the bus. 

It’s true that with sufficient time and motivation, a dedicated and well-funded adversary can defeat almost any protection mechanism. But our job as defenders is to raise the bar so that cheap and inexpensive attacks are no longer feasible. By raising the cost of exploitation beyond the adversary’s appetite, we eliminate entire classes of attack.

Choosing to do nothing simply because other attack avenues exist is a little too defeatist of an attitude for me. Especially given that the TPM specification does support payload encryption and integrity protection through the use of Authorization Sessions. So we do have the necessary tools to begin to solve this problem. Unfortunately, it is also true that this issue extends beyond the kernel. We also need to land similar patches for every stage of the boot process that performs a PCR Extend operation. Otherwise the chain of trust can be broken before the kernel is even started. 

All that said, I’m pretty invested in TPM Genie, so I am obviously biased towards seeing a fix. 

Jeremy

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2703 bytes --]

  reply	other threads:[~2018-11-21  2:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 17:34 Documenting the proposal for TPM 2.0 security in the face of bus interposer attacks James Bottomley
2018-11-19 20:05 ` Jason Gunthorpe
2018-11-19 20:20   ` James Bottomley
2018-11-19 21:19     ` Jason Gunthorpe
2018-11-19 21:34       ` James Bottomley
2018-11-19 21:44         ` Jason Gunthorpe
2018-11-19 22:36           ` James Bottomley
2018-11-19 23:08             ` Jason Gunthorpe
2018-11-20  0:54               ` James Bottomley
2018-11-20  3:05                 ` Jason Gunthorpe
2018-11-20 17:17                   ` James Bottomley
2018-11-20 21:33                     ` Jason Gunthorpe
2018-11-20 22:34                       ` James Bottomley
2018-11-20 23:39                         ` Jason Gunthorpe
2018-11-21  2:24                           ` Jeremy Boone [this message]
2018-11-21  5:16                             ` EXTERNAL: " Jason Gunthorpe
2018-11-20 23:52                       ` Jarkko Sakkinen
2018-11-20 23:41                     ` Jarkko Sakkinen
2018-11-20 11:10 ` Jarkko Sakkinen
2018-11-20 12:41   ` Jarkko Sakkinen
2018-11-20 17:25     ` James Bottomley
2018-11-20 23:13       ` Jarkko Sakkinen
2018-11-20 23:58         ` James Bottomley
2018-11-21  0:33           ` EXTERNAL: " Jeremy Boone
2018-11-21  6:37           ` Jarkko Sakkinen
2018-11-21  5:42         ` Jason Gunthorpe
2018-11-21  7:18           ` Jarkko Sakkinen
     [not found]             ` <F10185EF-C618-45DC-B1F3-0053B8FE417F@gmail.com>
2018-11-21  9:07               ` Jarkko Sakkinen
2018-11-21  9:14             ` Jarkko Sakkinen
2018-11-20 17:23   ` James Bottomley
2018-11-20 23:12     ` Jarkko Sakkinen
2018-12-10 16:33 ` Ken Goldman
2018-12-10 17:30   ` James Bottomley
2018-12-11 21:47     ` Ken Goldman

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=01A99B24-E772-489C-A33F-2F3CC80281FA@nccgroup.com \
    --to=jeremy.boone@nccgroup.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mjg59@google.com \
    --cc=monty.wiseman@ge.com \
    --cc=montywiseman32@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 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).