Skip to content

Commit 5e5c20a

Browse files
committed
modules/tpm-gpio-reset: TPM GPIO reset audit and assertion tools
Adds tpm-gpio-detect (audit) and tpm-gpio-assert (execute) from tlaurion/tpm-gpio-fail, based on Mate Kukri original PoC. Libpci PCI access. PCR output before/after assertion. ASCII output. Module depends on pciutils, tpm2-tools. Built when CONFIG_TPM2_TOOLS=y. TESTED: NV4x ADL-P (0x5182) — PCRs cleared to zero, confirmed. ALL OTHER PLATFORMS UNTESTED. Docs: TPM GPIO vulnerability docs point to Heads Wiki threat model. initrd: .bash_history entries for recovery shell testing. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent 50f4807 commit 5e5c20a

7 files changed

Lines changed: 74 additions & 2147 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ bin_modules-$(CONFIG_NKSTORECLI) += nkstorecli
750750
bin_modules-$(CONFIG_UTIL_LINUX) += util-linux
751751
bin_modules-$(CONFIG_OPENSSL) += openssl
752752
bin_modules-$(CONFIG_TPM2_TOOLS) += tpm2-tools
753+
bin_modules-$(CONFIG_TPM2_TOOLS) += tpm-gpio-reset
753754
bin_modules-$(CONFIG_BASH) += bash
754755
bin_modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils
755756
bin_modules-$(CONFIG_IO386) += io386

doc/BOARDS_AND_TESTERS.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,15 @@ QSB-107 exposure rates.
9595

9696
## TPM GPIO Reset Vulnerability
9797

98-
*For a detailed analysis including per-platform feasibility, attack steps,
99-
and upstream tracking, see [TPM_GPIO_Reset_Vulnerability.md](TPM_GPIO_Reset_Vulnerability.md).*
100-
101-
Heads relies on coreboot to lock PCH GPIO pad configuration before booting
102-
the OS. On many Intel platforms, coreboot fails to set these lock bits.
103-
If pads are unlocked, post-coreboot code can reprogram the PLTRST# pin to
104-
GPIO mode and assert it, forcing a TPM Reset.
105-
106-
Attack chain:
107-
1. Attacker asserts PLTRST# via GPIO, resetting the TPM to power-on state
108-
(PCRs cleared to zero; NVRAM preserved).
109-
2. Attacker replays known PCR measurements (boot hashes are deterministic)
110-
to reconstruct the sealed PCR state.
98+
Many Intel platforms are vulnerable to a TPM GPIO reset bypass
99+
([mkukri.xyz, 2024](https://mkukri.xyz/2024/06/01/tpm-gpio-fail.html)).
100+
See the [Heads Wiki Threat Model](https://github.com/linuxboot/heads-wiki/blob/master/About/Heads-threat-model.md)
101+
for per-platform status and mitigation. Test with:
102+
103+
```bash
104+
tpm-gpio-detect 2>&1 | tee /media/tpm-gpio-detect.log
105+
tpm-gpio-assert 2>&1 | tee /media/tpm-gpio-assert.log
106+
```
111107
3. Since PCRs match sealed values, `tpm2 unseal` succeeds, extracting the
112108
TOTP/HOTP shared secret.
113109

0 commit comments

Comments
 (0)