drivers/char/tpm/tpm_crb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
all AMD fTPMs") doesn't work properly on Intel fTPM. The TPM doesn't reply
at bootup and returns back the command code.
As this isn't crucial for anything but AMD fTPM and AMD fTPM works, throw
away the error code to let Intel fTPM continue to work.
Cc: stable@vger.kernel.org
Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/char/tpm/tpm_crb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 9eb1a18590123..b0e9931fe436c 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -472,8 +472,7 @@ static int crb_check_flags(struct tpm_chip *chip)
if (ret)
return ret;
- ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL);
- if (ret)
+ if (tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL))
goto release;
if (val == 0x414D4400U /* AMD */)
--
2.34.1
On 8/18/23 14:15, Mario Limonciello wrote:
> The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
> all AMD fTPMs") doesn't work properly on Intel fTPM. The TPM doesn't reply
> at bootup and returns back the command code.
>
> As this isn't crucial for anything but AMD fTPM and AMD fTPM works, throw
> away the error code to let Intel fTPM continue to work.
>
FWIW there is a Fedora bug where several people are reporting similar issues:
https://bugzilla.redhat.com/show_bug.cgi?id=2232888
Dusty
On Mon Aug 28, 2023 at 6:47 PM EEST, Dusty Mabe wrote:
>
>
> On 8/18/23 14:15, Mario Limonciello wrote:
> > The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
> > all AMD fTPMs") doesn't work properly on Intel fTPM. The TPM doesn't reply
> > at bootup and returns back the command code.
> >
> > As this isn't crucial for anything but AMD fTPM and AMD fTPM works, throw
> > away the error code to let Intel fTPM continue to work.
> >
>
> FWIW there is a Fedora bug where several people are reporting similar issues:
> https://bugzilla.redhat.com/show_bug.cgi?id=2232888
>
> Dusty
I just sent v4 with reported-by's added despite:
1. checkpatch.pl complaining about them
2. no mention of the bugzilla in the kernel documentation at least not
in the sections describing the process handling the patches
BR, Jarkko
On Fri Aug 18, 2023 at 6:15 PM UTC, Mario Limonciello wrote:
> The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
> all AMD fTPMs") doesn't work properly on Intel fTPM. The TPM doesn't reply
> at bootup and returns back the command code.
Is this reproducible with any production hardware? You are stating it
as it was reproducible categorically with any Intel fTPM.
> As this isn't crucial for anything but AMD fTPM and AMD fTPM works, throw
> away the error code to let Intel fTPM continue to work.
>
> Cc: stable@vger.kernel.org
> Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
It does make sense not to exercise this outside of AMD CPus but since
there is no production hardware failing, it cannot be categorized as a
bug fix.
> Reported-by: Todd Brandt <todd.e.brandt@intel.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/char/tpm/tpm_crb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> index 9eb1a18590123..b0e9931fe436c 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -472,8 +472,7 @@ static int crb_check_flags(struct tpm_chip *chip)
> if (ret)
> return ret;
>
> - ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL);
> - if (ret)
> + if (tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL))
> goto release;
It would be better not to exercise a potentially failing code path at
all. This initiates full transaction with the TPM.
>
> if (val == 0x414D4400U /* AMD */)
> --
> 2.34.1
BR, Jarkko
© 2016 - 2025 Red Hat, Inc.