tpm: Fix expected number of response bytes of TPM1.2 PCR Extend
PATCH 1/1 tpm: Fix expected number of response bytes of TPM1.2 PCR Extend
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.
--- drivers/char/tpm/tpm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm-interface.c +1 -1
@@ -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 20static const struct tpm_input_header pcrextend_header = { .tag =TPM_TAG_RQU_COMMAND , .length =cpu_to_be32 (34 ),
Signature · 1 line
2.4.3
Quoted 8 lines · Stefan Berger
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 <[email protected]>Acked-by Mimi Zohar <[email protected]>
/Jarkko
Quoted 20 lines
--- drivers/char/tpm/tpm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/tpm/tpm-interface.c +1
-1@@ -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 20static const struct tpm_input_header pcrextend_header = { .tag =TPM_TAG_RQU_COMMAND , .length =cpu_to_be32 (34 ),Signature · 1 line
2.4.3
A message that is not in the archive (sent off-list or not yet received): 20170215180903.3simazptqnlhbqi6-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Quoted 17 lines · Jarkko Sakkinen
Quoted 8 lines · Stefan Berger
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 <[email protected]>/Jarkko
Quoted 4 lines
--- drivers/char/tpm/tpm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
drivers/char/tpm/tpm-interface.c EXPORT_SYMBOL_GPL(tpm_pcr_read); · line 769
Quoted 8 lines
drivers/char/tpm/tpm-interface.c +0
-0@@ -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
We should probably rename the above to EXTEND_PCR_BUFFER_SIZE. It's the input buffer that's size 34, the output is 30 bytes.
Stefan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Hi James,
Quoted 11 lines · Jarkko Sakkinen
Quoted 8 lines · Stefan Berger
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 <[email protected]>Acked-by Mimi Zohar <[email protected]>Reviewed-by Jarkko Sakkinen <[email protected]>
This patch needs to be included with the rest of the patches being
upstreamed in the next open window. Should Jarkko or I send you a pull
request for it?
thanks,
Mimi
Quoted 15 lines · Mimi Zohar
Hi James,
Quoted 11 lines · Jarkko Sakkinen
Quoted 8 lines · Stefan Berger
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 <[email protected]>Acked-by Mimi Zohar <[email protected]>Reviewed-by Jarkko Sakkinen <[email protected]>
Quoted 7 lines
This patch needs to be included with the rest of the patches being
upstreamed in the next open window. Should Jarkko or I send you a pull
request for it?thanks,
Mimi
I'm sending a pull request after the weekend. It will contain only a few small scoped fixes so wouldn't it be easiest if I just include this to the pack?
/Jarkko
Quoted 16 lines · Jarkko Sakkinen
Quoted 15 lines · Mimi Zohar
Hi James,
Quoted 11 lines · Jarkko Sakkinen
Quoted 8 lines · Stefan Berger
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 <[email protected]>
Quoted 7 lines
Quoted 3 lines
This patch needs to be included with the rest of the patches being
upstreamed in the next open window. Should Jarkko or I send you a pull
request for it?I'm sending a pull request after the weekend. It will contain only a few small scoped fixes so wouldn't it be easiest if I just include this to the pack?
As long as it makes it into the James' pull request to Linus, that's fine.
Mimi
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot