diff options
author | Jarkko Sakkinen | 2016-08-16 21:00:38 +0200 |
---|---|---|
committer | Jarkko Sakkinen | 2016-09-15 15:04:21 +0200 |
commit | d4816edfe706497a8525480c1685ceb9871bc118 (patch) | |
tree | 73c4afa873f131ab70998332b9f4ece9e6f83d24 /drivers/char/tpm/tpm-sysfs.c | |
parent | tpm: invalid self test error message (diff) | |
download | kernel-qcow2-linux-d4816edfe706497a8525480c1685ceb9871bc118.tar.gz kernel-qcow2-linux-d4816edfe706497a8525480c1685ceb9871bc118.tar.xz kernel-qcow2-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-sysfs.c')
-rw-r--r-- | drivers/char/tpm/tpm-sysfs.c | 2 |
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; |