U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jorge Ramirez-Ortiz, Foundries" <jorge@foundries.io>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Tim Harvey <tharvey@gateworks.com>,
	u-boot@lists.denx.de,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jorge Ramirez-Ortiz <jorge@foundries.io>,
	Adam Ford <aford173@gmail.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: Re: [PATCH v3] tpm: display warning if using gpio reset with TPM
Date: Thu, 16 May 2024 11:09:11 +0200	[thread overview]
Message-ID: <ZkXNN4I/gFgjD3oP@trex> (raw)
In-Reply-To: <20240516090950.373d304c@xps-13>

On 16/05/24 09:09:50, Miquel Raynal wrote:
> Hi Tim,
> 
> tharvey@gateworks.com wrote on Wed, 15 May 2024 16:21:38 -0700:
> 
> > Instead of displaying what looks like an error message if a
> > gpio-reset dt prop is missing for a TPM display a warning that
> > having a gpio reset on a TPM should not be used for a secure production
> > device.
> > 
> > TCG TIS spec [1] says:
> > "The TPM_Init (LRESET#/SPI_RST#) signal MUST be connected to the
> > platform CPU Reset signal such that it complies with the requirements
> > specified in section 1.2.7 HOST Platform Reset in the PC Client
> > Implementation Specification for Conventional BIOS."
> > 
> > The reasoning is that you should not be able to toggle a GPIO and reset
> > the TPM without resetting the CPU as well because if an attacker can
> > break into your OS via an OS level security flaw they can then reset the
> > TPM via GPIO and replay the measurements required to unseal keys
> > that you have otherwise protected.
> > 
> > Additionally restructure the code for improved readability allowing for
> > removal of the init label.
> > 
> > Before:
> >  - board with no reset gpio
> > u-boot=> tpm init && tpm info
> > tpm_tis_spi_probe: missing reset GPIO
> > tpm@1 v2.0: VendorID 0x1114, DeviceID 0x3205, RevisionID 0x01 [open]
> >  - board with a reset gpio
> > u-boot=> tpm init && tpm info
> > tpm@1 v2.0: VendorID 0x1114, DeviceID 0x3205, RevisionID 0x01 [open]
> > 
> > After:
> >  - board with no reset gpio
> > u-boot=> tpm init && tpm info
> > tpm@1 v2.0: VendorID 0x1114, DeviceID 0x3205, RevisionID 0x01 [open]
> >  - board with a reset gpio
> > u-boot=> tpm init && tpm info
> > tpm@1: TPM gpio reset should not be used on secure production devices
> > tpm@1 v2.0: VendorID 0x1114, DeviceID 0x3205, RevisionID 0x01 [open]
> > 
> > [1] https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClientTPMInterfaceSpecification_TIS__1-3_27_03212013.pdf
> > 
> > Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> 
> Looks way cleaner, thanks.
> 
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> 
> Miquèl

nice. if needed

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>

  reply	other threads:[~2024-05-16  9:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 23:21 [PATCH v3] tpm: display warning if using gpio reset with TPM Tim Harvey
2024-05-16  7:09 ` Miquel Raynal
2024-05-16  9:09   ` Jorge Ramirez-Ortiz, Foundries [this message]
2024-05-16  9:34     ` Miquel Raynal
2024-05-16  9:46       ` Jorge Ramirez-Ortiz, Foundries
2024-05-16 10:40         ` Miquel Raynal
2024-05-21 19:04           ` Ilias Apalodimas
2024-05-21 19:01 ` Ilias Apalodimas

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=ZkXNN4I/gFgjD3oP@trex \
    --to=jorge@foundries.io \
    --cc=aford173@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /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