[GIT PULL] TPM bugfix

From: James Morris
Date: Mon Oct 31 2016 - 11:29:37 EST


Please pull this fix for 4.9.

The following changes since commit 2a26d99b251b8625d27aed14e97fc10707a3a81f:

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2016-10-29 20:33:20 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git for-linus

for you to fetch changes up to befd99656c5eb765fe9d96045c4cba099fd938db:

tpm: remove invalid min length check from tpm_do_selftest() (2016-10-31 09:15:27 -0600)

----------------------------------------------------------------
Jarkko Sakkinen (1):
tpm: remove invalid min length check from tpm_do_selftest()

drivers/char/tpm/tpm-interface.c | 3 ---
1 file changed, 3 deletions(-)


---

commit befd99656c5eb765fe9d96045c4cba099fd938db
Author: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
Date: Tue Oct 4 09:49:47 2016 +0300

tpm: remove invalid min length check from tpm_do_selftest()

Removal of this check was not properly amended to the original commit.

Cc: stable@xxxxxxxxxxxxxxx
Fixes: 0c541332231e ("tpm: use tpm_pcr_read_dev() in tpm_do_selftest()")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
Signed-off-by: James Morris <james.l.morris@xxxxxxxxxx>

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 8de6187..3a9149c 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -813,9 +813,6 @@ int tpm_do_selftest(struct tpm_chip *chip)
continue;
}

- if (rc < TPM_HEADER_SIZE)
- return -EFAULT;
-
if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) {
dev_info(&chip->dev,
"TPM is disabled/deactivated (0x%X)\n", rc);