From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de, Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Jorge Ramirez-Ortiz <jorge@foundries.io>,
Adam Ford <aford173@gmail.com>,
Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
Tim Harvey <tharvey@gateworks.com>
Subject: [PATCH v2] tpm: display warning if using gpio reset with TPM
Date: Wed, 27 Mar 2024 15:12:05 -0700 [thread overview]
Message-ID: <20240327221205.1871317-1-tharvey@gateworks.com> (raw)
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.
[1] https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClientTPMInterfaceSpecification_TIS__1-3_27_03212013.pdf
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
v2: change the message to a warning and update commit desc/log
---
drivers/tpm/tpm2_tis_spi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c
index de9cf8f21e07..c9c83f6f0fc8 100644
--- a/drivers/tpm/tpm2_tis_spi.c
+++ b/drivers/tpm/tpm2_tis_spi.c
@@ -237,14 +237,14 @@ static int tpm_tis_spi_probe(struct udevice *dev)
/* legacy reset */
ret = gpio_request_by_name(dev, "gpio-reset", 0,
&reset_gpio, GPIOD_IS_OUT);
- if (ret) {
- log(LOGC_NONE, LOGL_NOTICE,
- "%s: missing reset GPIO\n", __func__);
+ if (ret)
goto init;
- }
log(LOGC_NONE, LOGL_NOTICE,
"%s: gpio-reset is deprecated\n", __func__);
}
+ log(LOGC_NONE, LOGL_WARNING,
+ "%s: TPM gpio reset should not be used on secure production devices\n",
+ dev->name);
dm_gpio_set_value(&reset_gpio, 1);
mdelay(1);
dm_gpio_set_value(&reset_gpio, 0);
--
2.25.1
next reply other threads:[~2024-03-27 22:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 22:12 Tim Harvey [this message]
2024-03-28 7:08 ` [PATCH v2] tpm: display warning if using gpio reset with TPM Ilias Apalodimas
2024-04-08 7:23 ` Miquel Raynal
2024-04-17 5:40 ` Ilias Apalodimas
2024-04-17 6:48 ` Miquel Raynal
2024-04-17 7:00 ` Ilias Apalodimas
2024-04-17 14:58 ` Tim Harvey
2024-04-17 15:07 ` 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=20240327221205.1871317-1-tharvey@gateworks.com \
--to=tharvey@gateworks.com \
--cc=aford173@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jorge@foundries.io \
--cc=miquel.raynal@bootlin.com \
--cc=rasmus.villemoes@prevas.dk \
--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 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.