Commit 56efdfd
committed
initrd: fix TPM1 counter auth regression (#2068)
PR #2068 introduced a regression where TPM1 rollback counter
operations passed the TPM owner passphrase as the counter auth
(-pwdc) instead of empty auth (SHA1("")) per TCG spec.
Impact: each boot triggered 3 TPM auth failures from counter
create/increment operations. Over multiple boots this accumulated
the TPM's dictionary attack (DA) failedTries counter until lockout
(~10 boots = 30 auth failures). Users reported "hours of waiting"
on affected hardware (m900). The regression was not immediately
visible because the owner passphrase happened to match on some
TPM implementations.
Fix: restore TCG-compliant empty counter auth:
- tpm1_counter_increment: detect explicit -pwdc '' and call tpm
directly, bypassing _tpm_auth_retry. Non-empty or absent -pwdc
falls through to owner-auth retry path for migration of counters
created by pre-fix code.
- check_tpm_counter: create counters with -pwdc '' instead of
owner passphrase.
- increment_tpm_counter: increment with -pwdc '' instead of
owner passphrase; counter_create fallback uses empty auth.
- oem-factory-reset.sh: create counters with -pwdc ''.
Signed-off-by: Thierry Laurion <insurgo@riseup.net>1 parent 7d3a28a commit 56efdfd
4 files changed
Lines changed: 54 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
333 | 352 | | |
334 | 353 | | |
335 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | | - | |
| 871 | + | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
| 433 | + | |
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| |||
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
446 | 453 | | |
447 | 454 | | |
448 | 455 | | |
| 456 | + | |
| 457 | + | |
449 | 458 | | |
450 | 459 | | |
451 | 460 | | |
452 | | - | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
456 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
457 | 476 | | |
458 | 477 | | |
459 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1848 | 1848 | | |
1849 | 1849 | | |
1850 | 1850 | | |
1851 | | - | |
| 1851 | + | |
| 1852 | + | |
1852 | 1853 | | |
1853 | 1854 | | |
1854 | 1855 | | |
| |||
1857 | 1858 | | |
1858 | 1859 | | |
1859 | 1860 | | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
| 1861 | + | |
| 1862 | + | |
1866 | 1863 | | |
1867 | 1864 | | |
1868 | 1865 | | |
| |||
1872 | 1869 | | |
1873 | 1870 | | |
1874 | 1871 | | |
1875 | | - | |
| 1872 | + | |
1876 | 1873 | | |
1877 | 1874 | | |
1878 | 1875 | | |
| |||
2050 | 2047 | | |
2051 | 2048 | | |
2052 | 2049 | | |
2053 | | - | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
2054 | 2053 | | |
2055 | 2054 | | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
2059 | | - | |
2060 | | - | |
2061 | | - | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | | - | |
2069 | 2055 | | |
2070 | 2056 | | |
2071 | 2057 | | |
| |||
2094 | 2080 | | |
2095 | 2081 | | |
2096 | 2082 | | |
2097 | | - | |
| 2083 | + | |
2098 | 2084 | | |
2099 | 2085 | | |
2100 | 2086 | | |
| |||
2104 | 2090 | | |
2105 | 2091 | | |
2106 | 2092 | | |
2107 | | - | |
| 2093 | + | |
2108 | 2094 | | |
2109 | 2095 | | |
2110 | 2096 | | |
| |||
2123 | 2109 | | |
2124 | 2110 | | |
2125 | 2111 | | |
| 2112 | + | |
2126 | 2113 | | |
2127 | 2114 | | |
2128 | 2115 | | |
2129 | | - | |
| 2116 | + | |
2130 | 2117 | | |
2131 | 2118 | | |
2132 | 2119 | | |
| |||
0 commit comments