Skip to content

Commit

Permalink
KEYS: trusted: Fix TPM reservation for seal/unseal
Browse files Browse the repository at this point in the history
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/[email protected]/

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 <[email protected]>
Acked-by: Mimi Zohar <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
James Bottomley authored and James Bottomley committed Apr 21, 2021
1 parent bf05bf1 commit 9d5171e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/keys/trusted-keys/trusted_tpm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int tpm2_seal_trusted(struct tpm_chip *chip,
if (i == ARRAY_SIZE(tpm2_hash_map))
return -EINVAL;

rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE);
rc = tpm_try_get_ops(chip);
if (rc)
return rc;

Expand Down

0 comments on commit 9d5171e

Please sign in to comment.