]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tpm: fix a race condition in tpm2_unseal_trusted()
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 16 Aug 2016 19:00:38 +0000 (22:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 15:50:39 +0000 (17:50 +0200)
commitb7bab5ad129477c430f3c138fd597e14916961a6
tree886bf0315f78b9be17c6a126531dbbbc33418634
parent889995959eb082d515effe001e51bbf2f7324059
tpm: fix a race condition in tpm2_unseal_trusted()

commit d4816edfe706497a8525480c1685ceb9871bc118 upstream.

Unseal and load operations should be done as an atomic operation. This
commit introduces unlocked tpm_transmit() so that tpm2_unseal_trusted()
can do the locking by itself.

Fixes: 0fe5480303a1 ("keys, trusted: seal/unseal with TPM 2.0 chips")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm-dev.c
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm-sysfs.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm2-cmd.c