Skip to content

wiki: align PCR table to code, add note for TPM defend lock and further work needed - #246

Merged
tlaurion merged 2 commits into
linuxboot:masterfrom
tlaurion:deepwiki-docs-iteration-1
Sep 7, 2026
Merged

wiki: align PCR table to code, add note for TPM defend lock and further work needed#246
tlaurion merged 2 commits into
linuxboot:masterfrom
tlaurion:deepwiki-docs-iteration-1

Conversation

@tlaurion

@tlaurion tlaurion commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Aligns the TPM PCR table in About/Keys.md with actual runtime behavior verified against cbmem -L output from a real Heads build.

Fixes #245

Changes

PCR table corrections:

  • PCR 0: note Intel Boot Guard (IBB via ACM) as future use
  • PCR 1: note coreboot Kconfig defines (CONFIG_PCR_HWID, CONFIG_PCR_BOOT_MODE) but runtime shows zero
  • PCR 2: correct to specific CBFS files measured (bootblock, fallback/*, bootsplash.jpg) — not "every CBFS file"
  • PCR 3: document as runtime data slot, currently empty, future DIMM-swap detection
  • PCR 4-7: add script references (usb-init.sh, kexec-insert-key.sh, kexec-select-boot.sh, sbin/insmod.sh, qubes-measure-luks.sh, cbfs-init.sh, uefi-init.sh)
  • PCR 16: preserved as original

New content:

  • DA lockout note under "TPM_Unseal errors": explains TPM 2 enforced (10-try, 1h recovery) vs TPM 1 vendor-specific, links PR #2124 as pending

Evidence

All claims verified against:

  • cbmem -L output (real hardware TPM log)
  • initrd/bin/*.sh (extend sites)
  • config/coreboot-*.config (54 files)
  • build/x86/coreboot-25.12/src/security/tpm/tspi/crtm.c (CBFS measurement routing)

- PCR0: remove misleading SRTM parenthetical; coreboot SRTM uses PCR2
- PCR1: mark as not used
- PCR2: add +data+blobs to reflect full measured boot scope
- PCR3: document as runtime data slot (currently empty by design)
- PCR4: add script citations (usb-init.sh:12, kexec-insert-key.sh:69, kexec-select-boot.sh:769)
- PCR5: add script citation (insmod.sh:49-55)
- PCR6: add script citation (qubes-measure-luks.sh:24)
- PCR7: add script citations (cbfs-init.sh:55-56, uefi-init.sh:23)
- PCR16: clarify as software-computed future PCR (not direct TPM extend)

Code verification: initrd/bin/*.sh (all extend sites), config/coreboot-*.config (54 files),
coreboot docs (PCRs 0-7 allocation table).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Copilot AI lite review requested due to automatic review settings September 7, 2026 19:24
@tlaurion tlaurion changed the title wiki: align PCR table to code (iteration 1 of N) wiki: align PCR table to code, add note for TPM defend lock and further work needed Sep 7, 2026
@tlaurion
tlaurion merged commit af9a473 into linuxboot:master Sep 7, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A few documentation updates are still internally inconsistent/ambiguous (notably PCR7 wording vs later explanation and DA lockout phrasing), which can mislead readers.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the Heads wiki documentation to better match observed TPM PCR extend behavior and related unseal failure modes, based on runtime measurements and referenced extend sites.

Changes:

  • Updates the PCR 0–7 descriptions (including adding script references for extend sites) to reflect current measured-boot behavior.
  • Adds a Dictionary Attack (DA) lockout note under “TPM_Unseal errors”.
  • Ignores a local .code-graph/ directory in .gitignore.
File summaries
File Description
About/Keys.md Revises PCR role descriptions and adds DA lockout documentation to align Keys page guidance with observed behavior.
.gitignore Adds .code-graph/ to ignored paths for local tooling artifacts.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread About/Keys.md
Comment on lines +180 to +184
2: [coreboot measured boot](https://doc.coreboot.org/security/vboot/measured_boot.html#platform-configuration-registers)
— bootblock, romstage, ramstage, payload, bootsplash.jpg, fallback/*.

3: Nothing for the moment
3: Runtime data slot — empty on all Heads builds. Coreboot can measure MRC
cache and hwinfo.hex here (DIMM-swap detection), currently disabled.
Comment thread About/Keys.md
Comment on lines +193 to +194
7: Heads CBFS files and UEFI binaries. Extended by `cbfs-init.sh`,
`uefi-init.sh`.
Comment thread About/Keys.md
Comment on lines +232 to +237
Unseal can also fail due to TPM Dictionary Attack Lockout after too many failed
authentication attempts. On TPM 2, Heads enforces a 10-try limit with 1-hour
recovery during TPM reset. On TPM 1, DA behavior is vendor-specific — Heads
has no tooling to configure it. Pending:
[PR #2124](https://github.com/linuxboot/heads/pull/2124) adds user-facing DA
lockout detection and guidance.
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 7, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: change from 'scratch use only' to 'unused' — calcfuturepcr
  is pure software, not a TPM extend to PCR 16
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 7, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: change from 'scratch use only' to accurate history — was
  scratch PCR on TPM1 (PCR 23 on TPM2) in old calcfuturepcr; now
  unused after rewrite to replay from cbmem -L event log
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 7, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: change from 'scratch use only' to accurate history — was
  scratch PCR on TPM1 (PCR 23 on TPM2) in old calcfuturepcr; now
  unused after rewrite to replay from cbmem -L event log
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 7, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: change from 'scratch use only' to accurate history — was
  scratch PCR on TPM1 (PCR 23 on TPM2) in old calcfuturepcr; now
  unused after rewrite to replay from cbmem -L event log
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 8, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: change from 'scratch use only' to accurate history — was
  scratch PCR on TPM1 (PCR 23 on TPM2) in old calcfuturepcr; now
  unused after rewrite to replay from cbmem -L event log
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 8, 2026
Extends wiki iteration-1 (linuxboot/heads-wiki#246) to doc/tpm.md.

- PCR 16: removed from security-model.md diagram — unused, not
  relevant to the security model
- kexec-seal-key.sh:274: fix stale comment that referenced PCR 16 —
  the code calls qubes-measure-luks.sh which extends PCR 6, not PCR 16

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify further TPM PCR roles and TPM Defend lock

2 participants