Skip to content

Commit f0926e9

Browse files
committed
doc: fix code/doc mismatches found in consistency review
- Add da_state and bad_auth to the subcommand reference table - Fix misleading NVRAM index claim (0x3135106223 is not fixed for TPM2) - Fix bad_auth debug.log claim: increment output goes to console - Fix _tpm_auth_retry comment: 'owner auth' -> 'authorization' (handles counter auth too) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent 6988bf3 commit f0926e9

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

doc/tpm.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Both TPM1 and TPM2 boards may also enable `CONFIG_TPMTOTP=y` for the
6565
| `reset` | Reset the TPM |
6666
| `kexec_finalize` | Finalize PCR state before kexec (TPM2 only) |
6767
| `shutdown` | Orderly shutdown (TPM2 only) |
68+
| `da_state` | Query dictionary attack lockout state |
69+
| `bad_auth` | Deliberately trigger an auth failure to test DA lockout |
6870

6971
---
7072

@@ -298,9 +300,11 @@ The rollback counter prevents **TPM swap attacks** and **/boot disk swap attacks
298300

299301
### How it works
300302

301-
The counter is stored **in the TPM** (NVRAM index `0x3135106223`), ensuring
302-
hardware binding. A SHA-256 hash of the counter value is stored on **/boot**
303-
(`/boot/kexec_rollback.txt`). This creates a two-way binding:
303+
The counter value is stored **in the TPM** at a persistent NVRAM index
304+
(stored in `/boot/kexec_rollback.txt`; the index is a well-known value
305+
for TPM1 and randomly generated per TPM2 at provisioning time). A SHA-256
306+
hash of the counter value is stored on **/boot** (`/boot/kexec_rollback.txt`).
307+
This creates a two-way binding:
304308

305309
- Cannot swap TPM without breaking /boot consistency
306310
- Cannot swap /boot without breaking TPM consistency
@@ -574,7 +578,8 @@ lockout behavior by deliberately triggering an auth failure:
574578
owner auth may not increment on some implementations. Shows DA state
575579
before and after each attempt.
576580

577-
Both log detailed output to debug.log for post-mortem analysis.
581+
Test headers and DA state queries are logged to debug.log for analysis;
582+
the increment command output goes to the console during interactive use.
578583

579584
#### Preventing future lockouts
580585

initrd/bin/tpmr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ tpm2_counter_inc() {
362362
DIE "Can't increment TPM counter for $index after 3 attempts, access denied."
363363
}
364364

365-
# _tpm_auth_retry - Shared retry helper for TPM commands needing owner auth.
365+
# _tpm_auth_retry - Shared retry helper for TPM commands needing authorization.
366366
#
367367
# Handles both TPM1 (tpmtotp: errors to stdout, uses -pwdo/-pwdc flags)
368368
# and TPM2 (tpm2-tools: errors to stderr, uses -P parameter).

0 commit comments

Comments
 (0)