]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: trusted: Fix TPM reservation for seal/unseal
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 21 Apr 2021 22:42:47 +0000 (15:42 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 21 Apr 2021 23:28:20 +0000 (16:28 -0700)
commitbc3139e7b04ddf68be15a93c855f1880cbf59788
treea517b164c71bab539f7f8a775346b2f75a4eb62b
parent627063ce1ae170bedca2e810696a43e13d71dd75
KEYS: trusted: Fix TPM reservation for seal/unseal

The original patch 41f9915b74d8 ("KEYS: trusted: Reserve TPM for seal
and unseal operations") was correct on the mailing list:

https://lore.kernel.org/linux-integrity/20210128235621.127925-4-jarkko@kernel.org/

But somehow got rebased so that the tpm_try_get_ops() in
tpm2_seal_trusted() got lost.  This causes an imbalanced put of the
TPM ops and causes oopses on TIS based hardware.

This fix puts back the lost tpm_try_get_ops()

Fixes: 41f9915b74d8 ("KEYS: trusted: Reserve TPM for seal and unseal operations")
Reported-by: Mimi Zohar <zohar@linux.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
security/keys/trusted-keys/trusted_tpm2.c