diff options
author | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-08-16 21:00:38 +0200 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-09-15 15:04:21 +0200 |
commit | d4816edfe706497a8525480c1685ceb9871bc118 (patch) | |
tree | 73c4afa873f131ab70998332b9f4ece9e6f83d24 /drivers/char/tpm/tpm-dev.c | |
parent | tpm: invalid self test error message (diff) | |
download | linux-d4816edfe706497a8525480c1685ceb9871bc118.tar.xz linux-d4816edfe706497a8525480c1685ceb9871bc118.zip |
tpm: fix a race condition in tpm2_unseal_trusted()
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")
Cc: stable@vger.kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Diffstat (limited to 'drivers/char/tpm/tpm-dev.c')
-rw-r--r-- | drivers/char/tpm/tpm-dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c index f5d452151c6b..912ad30be585 100644 --- a/drivers/char/tpm/tpm-dev.c +++ b/drivers/char/tpm/tpm-dev.c @@ -145,7 +145,7 @@ static ssize_t tpm_write(struct file *file, const char __user *buf, return -EPIPE; } out_size = tpm_transmit(priv->chip, priv->data_buffer, - sizeof(priv->data_buffer)); + sizeof(priv->data_buffer), 0); tpm_put_ops(priv->chip); if (out_size < 0) { |