Commit Message

If a TPM2 loses power without a TPM2_Shutdown command being issued (a
"disorderly reboot"), it may lose some state that has yet to be
persisted to NVRam, and will increment the DA counter. After the DA
counter gets sufficiently large, the TPM will lock the user out.
NOTE: This only changes behavior on TPM2 devices. Since TPM1 uses sysfs,
and sysfs relies on implicit locking on chip->ops, it is not safe to
allow this code to run in TPM1, or to add sysfs support to TPM2, until
that locking is made explicit.
Signed-off-by: Josh Zimmerman <joshz@google.com>
Cc: stable@vger.kernel.org
----
v2:
- Properly split changes between this and another commit
- Use proper locking primitive.
- Fix commenting style
v3:
- Re-fix commenting style
v4:
- Update description and tags (Reviewed-by, Cc).
v5:
- Update documentation.
v6:
- Call device or bus shutdown from tpm_shutdown.
---
drivers/char/tpm/tpm-chip.c | 31 +++++++++++++++++++++++++++++++
drivers/char/tpm/tpm-sysfs.c | 3 +++
2 files changed, 34 insertions(+)