tpm: add session encryption protection to tpm2_get_random()
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 29 Apr 2024 20:28:07 +0000 (16:28 -0400)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 9 May 2024 19:30:51 +0000 (22:30 +0300)
commit1b6d7f9eb150305dcb0da4f7101a8d30dcdf0497
tree29b30c0ec3d13eb7760664a8d89546aada1c527d
parent6519fea6fd372b2247a48d72dcb23e14de70b4ea
tpm: add session encryption protection to tpm2_get_random()

If some entity is snooping the TPM bus, they can see the random
numbers we're extracting from the TPM and do prediction attacks
against their consumers.  Foil this attack by using response
encryption to prevent the attacker from seeing the random sequence.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm2-cmd.c