Skip to content

doc: align TPM docs with code (PCR roles, sealing, counter) - #2203

Merged
tlaurion merged 4 commits into
linuxboot:masterfrom
tlaurion:doc/tpm-pcr-corrections
Sep 17, 2026
Merged

tlaurion merged 4 commits into
linuxboot:masterfrom
tlaurion:doc/tpm-pcr-corrections

Conversation

@tlaurion

@tlaurion tlaurion commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Documentation and comments only; no runtime behaviour change.

This branch brings the TPM documentation and the stale comments in initrd/ back in line with what the sealing and attestation code actually does. It follows the earlier PCR/TPM doc sweeps (#1172, #2068).

Four commits over master (all GPG-signed and signed off):

  • 7a4acb6d0fb tpm: align documentation with sealing and attestation code — rollback wording now separates a missing record (gated by CONFIG_BOOT_REQ_ROLLBACK) from a mismatched existing record (aborts unless CONFIG_IGNORE_ROLLBACK); removes the dead owner-passphrase wiring from seal-totp.sh and states the real 8-character minimum.
  • ffe2bf2411c initrd: correct stale TPM comments — comments across gui-init.sh, tpmr.sh, seal-hotpkey.sh, unseal-hotp.sh, seal-totp.sh, functions.sh, unseal-totp.sh and wipe-totp.sh now match the code.
  • 46504c9b47c doc: cross-reference tpm.md and qualify the BootGuard IBB claim — the PCR map, seal policies and rollback binding are no longer restated across architecture.md, boot-process.md, keys.md and security-model.md; they point at doc/tpm.md. The BootGuard sentence no longer reads as unconditional: legacy Intel TXT references the IBB by FIT type 7, while CBnT takes the digest from the signed Boot Policy Manifest.
  • 4043ff21989 doc: add IBB measurement and PCR 0 prerequisites — new doc/ibb-measurement.md plus the index.md row and a pointer from doc/tpm.md.

No testing performed: there is no behaviour to test.

Copilot AI lite review requested due to automatic review settings September 7, 2026 19:44

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

Repository documentation is left internally inconsistent (doc/security-model.md still describes PCR 16 as calcfuturepcr “scratch”), which undermines the accuracy goal of this doc-focused PR.

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

Pull request overview

This PR corrects TPM PCR documentation and updates a stale comment in the initrd sealing flow to accurately reflect which PCR is extended during LUKS header measurement.

Changes:

  • Updates the doc/tpm.md PCR table to mark PCR 16 as unused by Heads and not part of any sealing policy.
  • Fixes a stale comment in initrd/bin/kexec-seal-key.sh to correctly describe measuring LUKS headers into PCR 6 and producing /tmp/luksDump.txt for calcfuturepcr.
File summaries
File Description
initrd/bin/kexec-seal-key.sh Updates the measurement comment to correctly reference PCR 6 and /tmp/luksDump.txt.
doc/tpm.md Corrects the PCR table entry for PCR 16 to reflect actual Heads behavior.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • 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 doc/tpm.md Outdated
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch 2 times, most recently from fcb9c6e to 13082a7 Compare September 7, 2026 19:55
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from 13082a7 to 5d590e9 Compare September 7, 2026 20:01
tlaurion added a commit to tlaurion/heads-wiki that referenced this pull request Sep 7, 2026
PCR 16 was historically scratch space for calcfuturepcr on TPM1
(PCR 23 on TPM2). calcfuturepcr was later rewritten to replay
from cbmem -L event log, eliminating the need for any scratch PCR.
PCR 16 is now unused.

Extends doc/tpm.md fix (linuxboot/heads#2203).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from 5d590e9 to 5072786 Compare September 7, 2026 23:59
tlaurion added a commit to tlaurion/heads-wiki that referenced this pull request Sep 7, 2026
PCR 16 was historically scratch space for calcfuturepcr on TPM1
(PCR 23 on TPM2). calcfuturepcr was later rewritten to replay
from cbmem -L event log, eliminating the need for any scratch PCR.
PCR 16 is now unused.

Extends doc/tpm.md fix (linuxboot/heads#2203).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch 3 times, most recently from 35e36b1 to a4c25a6 Compare September 8, 2026 02:08
tlaurion added a commit to tlaurion/heads-wiki that referenced this pull request Sep 8, 2026
PCR 16 was historically scratch space for calcfuturepcr on TPM1
(PCR 23 on TPM2). calcfuturepcr was later rewritten to replay
from cbmem -L event log, eliminating the need for any scratch PCR.
PCR 16 is now unused.

Extends doc/tpm.md fix (linuxboot/heads#2203).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch 2 times, most recently from 15f93dd to 027ac34 Compare September 15, 2026 21:11
@tlaurion tlaurion changed the title doc: fix PCR table and stale comment doc: align TPM docs with code (PCR roles, sealing, counter) Sep 16, 2026
tlaurion added a commit to tlaurion/heads-wiki that referenced this pull request Sep 16, 2026
PCR 16 was historically scratch space for calcfuturepcr on TPM1
(PCR 23 on TPM2). calcfuturepcr was later rewritten to replay
from cbmem -L event log, eliminating the need for any scratch PCR.
PCR 16 is now unused.

Extends doc/tpm.md fix (linuxboot/heads#2203).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from 027ac34 to 28913d7 Compare September 16, 2026 17:31
@tlaurion
tlaurion requested a lite review from Copilot September 16, 2026 18:32

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

Unresolved corrections remain for platform-specific PCR behavior, logging semantics, comments, and a cross-reference.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (6)

doc/architecture.md:40

  • The updated anchor is correct here, but doc/architecture.md:135 still links to the removed #srtm-in-coreboot anchor, so the cross-reference correction remains incomplete and that page still sends readers to a broken link. Please update the remaining reference as well.
[tpm.md](tpm.md#root-of-trust-and-srtm-chain) for per-board TPM init timing.

doc/logging.md:127

  • This exact INFO message is emitted by both kexec-insert-key.sh after a DUK unseal and kexec-select-boot.sh when the DUK path is skipped (! -r /tmp/kexec/kexec_key_devices.txt). Describing it only as a DUK-unseal-path message omits the second normal-boot caller; please label it as the normal boot-mode PCR[4] extend more generally.
* `INFO "TPM: Extending PCR[4] with content of string 'generic' to prevent secret unsealing"` — boot-mode string extend on the DUK unseal path

doc/security-model.md:393

  • This diagram still labels PCR 0 as anchored at zero, but BootGuard Measured Boot can populate PCR 0 before coreboot; only PCRs 1 and 3 are unconditionally zero in the documented configuration. Please qualify PCR 0 here so the diagram does not contradict the PCR table.
│  │  PCR 0,1,3: Unused; anchored as zero    PCR 2: coreboot SRTM          │  │

doc/security-model.md:404

  • This second seal-policy diagram repeats the unconditional PCR 0,1,3 zero claim. BootGuard's measured-boot policy can extend PCR 0 before coreboot, so please qualify PCR 0 here as well and leave the zero-anchor statement for PCRs 1 and 3.
│  │  PCR 0,1,3: Unused; anchored as zero    PCR 2: coreboot SRTM          │  │

doc/tpm.md:170

  • This paragraph says PCR 0 remains zero unconditionally, but the table above and the following text document that an Intel BootGuard Measured Boot policy can extend PCR 0 before coreboot. Please limit the unconditional zero-state statement to PCRs 1 and 3 and qualify PCR 0.
PCRs 0-3 are read at seal time and included in sealing policies. The zero
state of PCRs 0, 1, and 3 is intentional — any unexpected extension of those
PCRs (e.g. enabling an optional coreboot feature) would break the seal.

doc/tpm.md:53

  • This status condition excludes the legacy boards that the next section explicitly lists as SRTM-capable: KGPE-D16 and the original Librem L1UM use CONFIG_TPM_INIT=y without CONFIG_TPM_MEASURED_BOOT. Please qualify this as the current-coreboot key and include the legacy key, otherwise the table reports their PCR2 measurements as inactive.
| SRTM (Static Root of Trust for Measurement) | PCR 2 (`CONFIG_PCR_SRTM=2`) | **Active on boards with TPM hardware and `CONFIG_TPM_MEASURED_BOOT=y`** (NO_TPM boards carry the `PCR_SRTM=2` slot but do not measure) |
  • Files reviewed: 6/9 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread doc/keys.md Outdated
Comment thread doc/security-model.md Outdated
Comment thread doc/tpm.md Outdated

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

One updated statement in doc/recovery-shell.md implies PCR4 is “set at boot” rather than extended on entry to the recovery shell, which undermines the PR’s goal of precise alignment with code behavior.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 6/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread doc/recovery-shell.md Outdated

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.

🟢 Approval recommended

Changes are documentation/comment-only alignment with existing behavior, with only minor terminology consistency feedback noted.

Review details
  • Files reviewed: 6/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread doc/tpm.md Outdated
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 15:25

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The comments no longer described the code they sat in. The DUK seal
always includes PCR 5, the TOTP/HOTP shared secret is sealed against
PCRs 0,1,2,3,4,7, and the TPM 2 finalize step does not extend PCRs.
Describe the counter split between the /boot HOTP file and the TPM
rollback counter as it is actually implemented.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
The PCR map, seal policies and rollback binding were restated in several
documents and could drift, so point at tpm.md as the maintained source
instead of repeating them. The BootGuard sentence also read as
unconditional, which is wrong on CBnT boards where the IBB digest comes
from the Boot Policy Manifest rather than PCR 0 alone, as raised in
linuxboot#1172.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 18:07

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from aedcc78 to e9b202d Compare September 17, 2026 20:03
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 20:03

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from e9b202d to 1362e52 Compare September 17, 2026 20:20
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 20:21

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from 1362e52 to 4346166 Compare September 17, 2026 20:56
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 20:56

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from 4346166 to 4c35582 Compare September 17, 2026 21:07
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 21:07

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The IBB and the prerequisites for a PCR 0 measurement are scattered
across the Intel TXT and CBnT specifications, the Dasharo fork and the
review history of the PCR measurement work. Document them in one place
so the PCR 0 row in tpm.md no longer has to stand alone, and point
tpm.md at the new page from the PCR assignments section.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 21:29

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion
tlaurion force-pushed the doc/tpm-pcr-corrections branch from bdc3530 to 4043ff2 Compare September 17, 2026 21:37
@tlaurion
tlaurion requested a lite review from Copilot September 17, 2026 21:37

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tlaurion

Copy link
Copy Markdown
Collaborator Author

if librem_l1um tanscient erros become a problem (old time race condition in fmd_scanner at build time) Heads upstream will drop it cc @JonathonHall-Purism,

It's a merge, didn't think of spending so much time here and in heads-wiki. Clean state unless proven otherwise through other issues. deepwiki will be refreshed and we will improve from AI understanding, since lack of user feeback, in free time,

@tlaurion
tlaurion merged commit 02bc77c into linuxboot:master Sep 17, 2026
17 of 48 checks passed
tlaurion added a commit to tlaurion/heads that referenced this pull request Sep 17, 2026
The claim that most client machines ship verified boot only, so PCR 0
stays zero, is not backed by any code or source. No code in initrd/
relies on it and the document cites nothing that states it, so remove it
rather than reword it into another generalization. What remains is
checkable: PCR 0 receives a Boot Guard ACM measurement when the platform
is provisioned with a profile that includes measurement, and a platform
provisioned without such a profile leaves PCR 0 unchanged.

The wording originated in linuxboot/heads-wiki#249 and was propagated
into doc/tpm.md by linuxboot#2203.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion added a commit to tlaurion/heads-wiki that referenced this pull request Sep 17, 2026
… claim

NovaCustom does not always ship unfused keys: units can ship unfused, but
production TrustRoot units are provisioned and only accept firmware signed
for the provisioned Boot Guard profile.

Remove the assertion that most client machines ship verified boot only and
therefore leave PCR 0 zero. Nothing supported that sentence, so it is deleted
rather than reworded into another generalization. PCR 0 is now described only
as receiving an ACM measurement when the platform is provisioned with a Boot
Guard profile that includes measurement. The sentence was introduced by this
work as linuxboot#249 and propagated into heads doc/tpm.md by
linuxboot/heads#2203. Documentation only.

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.

2 participants