summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm-dev.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-08-16 22:00:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-16 17:50:39 +0200
commitb7bab5ad129477c430f3c138fd597e14916961a6 (patch)
tree886bf0315f78b9be17c6a126531dbbbc33418634 /drivers/char/tpm/tpm-dev.c
parent889995959eb082d515effe001e51bbf2f7324059 (diff)
downloadlinux-stable-b7bab5ad129477c430f3c138fd597e14916961a6.tar.gz
linux-stable-b7bab5ad129477c430f3c138fd597e14916961a6.tar.bz2
linux-stable-b7bab5ad129477c430f3c138fd597e14916961a6.zip
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>
Diffstat (limited to 'drivers/char/tpm/tpm-dev.c')
-rw-r--r--drivers/char/tpm/tpm-dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c
index de0337ebd658..4f3137d9a35e 100644
--- a/drivers/char/tpm/tpm-dev.c
+++ b/drivers/char/tpm/tpm-dev.c
@@ -139,7 +139,7 @@ static ssize_t tpm_write(struct file *file, const char __user *buf,
/* atomic tpm command send and result receive */
out_size = tpm_transmit(priv->chip, priv->data_buffer,
- sizeof(priv->data_buffer));
+ sizeof(priv->data_buffer), 0);
if (out_size < 0) {
mutex_unlock(&priv->buffer_mutex);
return out_size;