]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tpm: Fix expected number of response bytes of TPM1.2 PCR Extend
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 15 Feb 2017 16:56:23 +0000 (11:56 -0500)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 15 Feb 2017 18:09:52 +0000 (20:09 +0200)
The TPM1.2 PCR Extend operation only returns 20 bytes in the body,
which is the size of the PCR state.

This fixes a problem where IMA gets errors with every PCR Extend.

Fixes: c659af78eb7b ("tpm: Check size of response before accessing data")
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@us.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c

index 6e368ee7bbecefd6f068fbe4cd6fb06a258c3068..bd2128e0b56cc8c4774acdd2adec682847d911f0 100644 (file)
@@ -767,7 +767,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
 
 #define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
 #define EXTEND_PCR_RESULT_SIZE 34
-#define EXTEND_PCR_RESULT_BODY_SIZE 24
+#define EXTEND_PCR_RESULT_BODY_SIZE 20
 static const struct tpm_input_header pcrextend_header = {
        .tag = TPM_TAG_RQU_COMMAND,
        .length = cpu_to_be32(34),