In commit 0aa698787aa2 ("tpm: Add Upgrade/Reduced mode support for
TPM2 modules") it was said that:
"If the TPM is in Failure mode, it will successfully respond to both
tpm2_do_selftest() and tpm2_startup() calls. Although, will fail to
answer to tpm2_get_cc_attrs_tbl(). Use this fact to conclude that TPM
is in Failure mode."
But a check was never added in the commit when calling
tpm2_get_cc_attrs_tbl() to conclude that the TPM is in Failure mode.
This commit corrects this by adding a check.
Fixes: 0aa698787aa2 ("tpm: Add Upgrade/Reduced mode support for TPM2 modules")
Cc: stable(a)vger.kernel.org # v5.17+
Signed-off-by: Mårten Lindahl <marten.lindahl(a)axis.com>
Reviewed-by: Jarkko Sakkinen <jarkko(a)kernel.org>
---
v4:
- Resend of patch because of invalid characters in Signed-off-by tag.
v3:
- Add Jarkkos Reviewed-by tag.
- Add Fixes tag and Cc.
v2:
- Add missed check for TPM error code.
drivers/char/tpm/tpm2-cmd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index c1eb5d223839..65d03867e114 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -752,6 +752,12 @@ int tpm2_auto_startup(struct tpm_chip *chip)
}
rc = tpm2_get_cc_attrs_tbl(chip);
+ if (rc == TPM2_RC_FAILURE || (rc < 0 && rc != -ENOMEM)) {
+ dev_info(&chip->dev,
+ "TPM in field failure mode, requires firmware upgrade\n");
+ chip->flags |= TPM_CHIP_FLAG_FIRMWARE_UPGRADE;
+ rc = 0;
+ }
out:
/*
--
2.30.2
Syzkaller reports NULL pointer dereference issues at ath9k_htc_rxep()
and ath9k_htc_tx_get_packet() in 5.10 stable releases. The problems have
been fixed by the following patch series which can be cleanly applied to
the 5.10 branch.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
Hello dear My name is Mr Bright Gawayn, It's my pleasure to contact you today.
We use a certain raw material in our pharmaceutical firm for the
manufacture of animal vaccines and many more.
My intention is to give you the new contact information of the local
manufacturer of this raw material in India and every details regarding
how to supply the material to my company if you're interested, my
company pays in advance for this material.
Due to some reasons, which I will explain in my next email, I cannot
procure this material and supply it to my company myself due to the
fact that I am a staff in the company.
Please get back to me as soon as possible for full detail if you are interested.
Thanks and regards
Bright.
Hello dear My name is Mr Bright Gawayn, It's my pleasure to contact you today.
We use a certain raw material in our pharmaceutical firm for the
manufacture of animal vaccines and many more.
My intention is to give you the new contact information of the local
manufacturer of this raw material in India and every details regarding
how to supply the material to my company if you're interested, my
company pays in advance for this material.
Due to some reasons, which I will explain in my next email, I cannot
procure this material and supply it to my company myself due to the
fact that I am a staff in the company.
Please get back to me as soon as possible for full detail if you are interested.
Thanks and regards
Bright.