summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm-sysfs.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-08-16 22:00:38 +0300
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-09-15 16:04:21 +0300
commitd4816edfe706497a8525480c1685ceb9871bc118 (patch)
tree73c4afa873f131ab70998332b9f4ece9e6f83d24 /drivers/char/tpm/tpm-sysfs.c
parentb7d7b28471072fc23e7b573aef89c14438092223 (diff)
downloadlinux-d4816edfe706497a8525480c1685ceb9871bc118.tar.bz2
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-sysfs.c')
-rw-r--r--drivers/char/tpm/tpm-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
index b46cf70c8b16..e1f7236c115c 100644
--- a/drivers/char/tpm/tpm-sysfs.c
+++ b/drivers/char/tpm/tpm-sysfs.c
@@ -39,7 +39,7 @@ static ssize_t pubek_show(struct device *dev, struct device_attribute *attr,
struct tpm_chip *chip = to_tpm_chip(dev);
tpm_cmd.header.in = tpm_readpubek_header;
- err = tpm_transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
+ err = tpm_transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE, 0,
"attempting to read the PUBEK");
if (err)
goto out;