diff options
author | Jarkko Sakkinen <jarkko@kernel.org> | 2023-04-26 20:29:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-30 14:03:16 +0100 |
commit | 7cd46930b8bf37b84777410ac21bfdf1179021d5 (patch) | |
tree | c453feb0fe67e32e194e6291d6f029751df5a2c8 /include | |
parent | 25d38d5eaa1f7a4d8075d23633f1722b38c8c7a7 (diff) | |
download | linux-stable-7cd46930b8bf37b84777410ac21bfdf1179021d5.tar.gz linux-stable-7cd46930b8bf37b84777410ac21bfdf1179021d5.tar.bz2 linux-stable-7cd46930b8bf37b84777410ac21bfdf1179021d5.zip |
tpm: Prevent hwrng from activating during resume
[ Upstream commit 99d46450625590d410f86fe4660a5eff7d3b8343 ]
Set TPM_CHIP_FLAG_SUSPENDED in tpm_pm_suspend() and reset in
tpm_pm_resume(). While the flag is set, tpm_hwrng() gives back zero
bytes. This prevents hwrng from racing during resume.
Cc: stable@vger.kernel.org
Fixes: 6e592a065d51 ("tpm: Move Linux RNG connection to hwrng")
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tpm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index cea64d58ef9f..4e22e4f4cec8 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h @@ -281,6 +281,7 @@ enum tpm_chip_flags { TPM_CHIP_FLAG_ALWAYS_POWERED = BIT(5), TPM_CHIP_FLAG_FIRMWARE_POWER_MANAGED = BIT(6), TPM_CHIP_FLAG_FIRMWARE_UPGRADE = BIT(7), + TPM_CHIP_FLAG_SUSPENDED = BIT(8), }; #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev) |