diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2021-03-10 17:19:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-22 10:59:20 +0200 |
commit | 315eab77e030b3b9549021855e598e596c1b8992 (patch) | |
tree | 479ac92e194ff5d4d6cfdd81eacfae2a60185b75 | |
parent | 49759f78f37956dca39cb5a0c4a8364f8717b7b6 (diff) | |
download | linux-stable-315eab77e030b3b9549021855e598e596c1b8992.tar.gz linux-stable-315eab77e030b3b9549021855e598e596c1b8992.tar.bz2 linux-stable-315eab77e030b3b9549021855e598e596c1b8992.zip |
tpm: vtpm_proxy: Avoid reading host log when using a virtual device
commit 9716ac65efc8f780549b03bddf41e60c445d4709 upstream.
Avoid allocating memory and reading the host log when a virtual device
is used since this log is of no use to that driver. A virtual
device can be identified through the flag TPM_CHIP_FLAG_VIRTUAL, which
is only set for the tpm_vtpm_proxy driver.
Cc: stable@vger.kernel.org
Fixes: 6f99612e2500 ("tpm: Proxy driver for supporting multiple emulated TPMs")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/char/tpm/eventlog/common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/tpm/eventlog/common.c b/drivers/char/tpm/eventlog/common.c index 7d70b654df04..462476467bff 100644 --- a/drivers/char/tpm/eventlog/common.c +++ b/drivers/char/tpm/eventlog/common.c @@ -112,6 +112,9 @@ void tpm_bios_log_setup(struct tpm_chip *chip) int log_version; int rc = 0; + if (chip->flags & TPM_CHIP_FLAG_VIRTUAL) + return; + rc = tpm_read_log(chip); if (rc < 0) return; |