Skip to content

Commit 9d5171e

Browse files
committed
KEYS: trusted: Fix TPM reservation for seal/unseal
The original patch 8c657a0 ("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: 8c657a0 ("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>
1 parent bf05bf1 commit 9d5171e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

security/keys/trusted-keys/trusted_tpm2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int tpm2_seal_trusted(struct tpm_chip *chip,
7979
if (i == ARRAY_SIZE(tpm2_hash_map))
8080
return -EINVAL;
8181

82-
rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE);
82+
rc = tpm_try_get_ops(chip);
8383
if (rc)
8484
return rc;
8585

0 commit comments

Comments
 (0)