modules/tpm-gpio-reset: TPM GPIO reset audit and assertion tools - #2165
Open
tlaurion wants to merge 4 commits into
Open
modules/tpm-gpio-reset: TPM GPIO reset audit and assertion tools#2165tlaurion wants to merge 4 commits into
tlaurion wants to merge 4 commits into
Conversation
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tlaurion
force-pushed
the
doc/tpm-gpio-vuln
branch
17 times, most recently
from
July 24, 2026 17:50
b3e7502 to
a2d99a3
Compare
13 tasks
tlaurion
force-pushed
the
doc/tpm-gpio-vuln
branch
3 times, most recently
from
July 24, 2026 18:39
f5c6544 to
4aa3965
Compare
tlaurion
force-pushed
the
doc/tpm-gpio-vuln
branch
15 times, most recently
from
July 31, 2026 02:30
f6108c4 to
5e5c20a
Compare
Collaborator
Author
|
Decided to extend @kukrimate Poc in fork and pack for all TPM2 based boards. @macpijan nv4x_adl confirmed vulnerable. From the repo's .bash_history at commit d8f1224: Fork commit: 0291c12 (module modules/tpm-gpio-reset pins CONFIG_TPM2_TOOLS=y). Two commands: tpm-gpio-detect (audit) then tpm-gpio-assert (execute — handles tpm2 shutdown/startup internally). |
tlaurion
force-pushed
the
doc/tpm-gpio-vuln
branch
7 times, most recently
from
July 31, 2026 04:35
3abc911 to
c527dc3
Compare
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>
tlaurion
force-pushed
the
doc/tpm-gpio-vuln
branch
from
July 31, 2026 04:46
c527dc3 to
d8f1224
Compare
tlaurion
marked this pull request as draft
July 31, 2026 04:57
tlaurion
marked this pull request as ready for review
July 31, 2026 04:57
Collaborator
Author
|
@Thrilleratplay @gaspar-ilom last review before merge please |
Collaborator
Author
|
Note that Alder Lake work has been made by @Sean-StarLabs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds tpm-gpio-detect (audit) and tpm-gpio-assert (execute) C binaries from the
tlaurion/tpm-gpio-fail fork
(commit
9052dbd, branchminimal-platform-fork), based onMate Kukri's original PoC.
modules/tpm-gpio-reset (new, 22 lines)
Builds both C binaries from the fork. Depends on pciutils and tpm2-tools.
Gated behind CONFIG_TPM2_TOOLS=y. Installs into initrd as
bin/tpm-gpio-detect and bin/tpm-gpio-assert.
tpm-gpio-detect (audit -- safe, read-only)
Uses libpci to find the ISA/LPC bridge by device class (no raw MMCFG).
Identifies the PCH platform, reads P2SB SBREG_BAR (hardcoded fallback
when hidden by FSP-S), then checks GPIO pad lock registers via /dev/mem:
PADCFGLOCK and PADCFGLOCKTX per PLTRST# pad (GPP_B13) and ESPI bus pins,
pad mode (NF1/GPIO), per-platform TIER classification. Self-documenting
ASCII table output with register values.
Exit codes: 0=all locked, >0=unlocked count, 2=not vulnerable by design,
126=unknown PCH, 127=hardware error.
tpm-gpio-assert (execute -- TPM may reboot, PCRs cleared, NVRAM preserved)
Calls tpm2 shutdown -c before and tpm2 startup -c after assertion.
Uses libpci to find the PCH, matching kukri's procedure.
Reads PADCFGLOCK/TX status, checks pad mode, performs NF1->GPIO
mode transition to create a PLTRST# reset edge:
PADRSTCFG (DW0 bits 31:30) selects pad reset trigger, not attack vector.
Exit codes: 0=DW0 verified, 1=DW0 locked, 2=not vulnerable, 126=unknown
PCH, 127=hardware error. ASCII-only output.
doc/TPM_GPIO_Reset_Approaches.md (new, 442 lines)
Developer reference: 8 approaches attempted on NV4x ADL-P, register
addresses verified against coreboot 26.06, GPIO lock status per
Dasharo/Purism forks, NF1->GPIO mode transition mechanism. TIER ordered:
TIER 1 (confirmed), TIER 2 (unconfirmed), TIER 3 (uncertain), NOT VULNERABLE.
doc/TPM_GPIO_Reset_Vulnerability.md (new, 23 lines)
Points to Heads Wiki Threat Model and Recovery Shell page.
doc/BOARDS_AND_TESTERS.md (+156/-62)
TPM GPIO vulnerability section referencing wiki. Restructured EOL/ESU board table.
initrd/.bash_history (+4 lines)
Recovery shell convenience commands. Removes bash-based PoC script.
doc/faq.md (-120 lines), doc/keys.md, doc/security-model.md
Reduced to wiki cross-references to avoid duplication.
Tested
NV4x ADL-P (0x5182) -- CONFIRMED VULNERABLE (TIER 1)
All other 13 platform families are untested
Report with tpm-gpio-detect 2>&1 | tee log. See fork issues.
Cross-references