tpm: fix tpm disabling if NULL name changes
Subsystems (2)
James Bottomley
maintainerPATCH 1/1 tpm: fix tpm disabling if NULL name changes
There's a logic error in the earlier fix which means that if the NULL name comparison fails, the tpm isn't disabled because rc remains zero. Fix this by setting it to an error.
---
I didn't actually discover this problem until I was trying to do a reset attack demo with an updated kernel.
drivers/char/tpm/tpm2-sessions.c | 1 + 1 file changed, 1 insertion(+)
drivers/char/tpm/tpm2- renamed from drivers/char/tpm/tpm2-sessions.c +0 -0
sessions.c
index 3b1cf1ca0420..bd1c0456e775 100644
drivers/char/tpm/tpm2-sessions.c +0 -0
@@ -961,6 +961,7 @@ static int tpm2_load_null(struct tpm_chip *chip,
u32 *null_key)
/* Deduce from the name change TPM interference: */ dev_err(&chip->dev, "null key integrity check failed\n"); tpm2_flush_context(chip, tmp_null_key);
+ rc = -ENODEV;
err:
if (rc) {
Signature · 1 line
2.51.0
Quoted 28 lines · James Bottomley
There's a logic error in the earlier fix which means that if the NULL name comparison fails, the tpm isn't disabled because rc remains zero. Fix this by setting it to an error.
Cc [email protected] # 6.12Fixes cc7d8594342a ("tpm: Rollback tpm2_load_null()")Signed-off-by James Bottomley <[email protected]>---
I didn't actually discover this problem until I was trying to do a reset attack demo with an updated kernel.
drivers/char/tpm/tpm2-sessions.c | 1 + 1 file changed, 1 insertion(+)drivers/char/tpm/tpm2- renamed from drivers/char/tpm/tpm2-sessions.c +0
-0
sessions.c
index3b1cf1ca0420..bd1c0456e775100644drivers/char/tpm/tpm2-sessions.c +1
-0@@ -961,6 +961,7 @@ static int tpm2_load_null(struct tpm_chip *chip, u32 *null_key) /* Deduce from the name change TPM interference: */ dev_err(&chip->dev, "null key integrity check failed\n");tpm2_flush_context (chip, tmp_null_key); + rc = -ENODEV ; err:
Quoted 5 lines
if (rc) {
Signature · 1 line
2.51.0
Possible to resend (fake ancestor)?
Other than that,
BR, Jarkko