Skip to content

Commit a5dfa14

Browse files
committed
fwTPM: document lockoutAuth recovery as post-boot uptime and platform escape hatch per review
1 parent df0fb83 commit a5dfa14

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

docs/FWTPM.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,16 @@ non-orderly shutdown adds a one-try penalty; on clockless builds neither applies
328328
power-off cannot accumulate into lockout. A failed `lockoutAuth` locks the
329329
lockout hierarchy: that lock persists across reboot and clears after
330330
`lockoutRecovery` seconds, except when `lockoutRecovery` is 0 (reboot-only
331-
recovery). `Startup`/`Shutdown` are never DA-gated, so a reboot in lockout can
332-
always recover. Entities marked `noDA` (`TPMA_OBJECT_noDA` on objects,
331+
recovery). Because the clock HAL reports milliseconds *since boot*, this timer
332+
measures continuous post-boot uptime, not wall-clock time across reboots — a
333+
device that reboots more often than `lockoutRecovery` extends its effective
334+
recovery window. The lock only blocks commands authorized via `lockoutAuth`
335+
(`DictionaryAttackLockReset`, `DictionaryAttackParameters`, lockout-authorized
336+
`Clear`); the platform hierarchy is always an escape hatch —
337+
`TPM2_ClearControl(platformAuth, clearDisable=NO)` then `TPM2_Clear(platformAuth)`
338+
recovers even when `disableClear` was set. `Startup`/`Shutdown` are never
339+
DA-gated, so a reboot in lockout can always recover. Entities marked `noDA`
340+
(`TPMA_OBJECT_noDA` on objects,
333341
`TPMA_NV_NO_DA` on NV indices) never feed the counter and stay usable during
334342
lockout. `TPM2_GetCapability(TPM_CAP_TPM_PROPERTIES)` reports
335343
`TPM_PT_MAX_AUTH_FAIL`, `TPM_PT_LOCKOUT_INTERVAL`, `TPM_PT_LOCKOUT_RECOVERY`,

src/fwtpm/fwtpm_command.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,9 @@ static TPM_RC FwCmd_Startup(FWTPM_CTX* ctx, TPM2_Packet* cmd, int cmdSize,
696696
* is 0, or when there is no clock HAL to time-heal it (clockless
697697
* targets must keep a reboot recovery path). Otherwise it persists and
698698
* recovers on the timer, so a power-cycle cannot brute-force
699-
* lockoutAuth. */
699+
* lockoutAuth. The clock HAL is ms-since-boot, so re-seeding the heal
700+
* baseline below measures recovery as continuous post-boot uptime; a
701+
* power-cycle restarts the window rather than clearing the lock. */
700702
if (ctx->daLockoutRecovery == 0 || ctx->clockHal.get_ms == NULL) {
701703
ctx->lockoutAuthFailed = 0;
702704
}

0 commit comments

Comments
 (0)