RE: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective

From: Limonciello, Mario
Date: Thu Jun 29 2023 - 22:31:50 EST


[Public]

> -----Original Message-----
> From: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
> Sent: Thursday, June 29, 2023 9:09 PM
> To: Limonciello, Mario <Mario.Limonciello@xxxxxxx>; Greg KH
> <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: peterhuewe@xxxxxx; jgg@xxxxxxxx; linux-integrity@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; Linux regressions mailing list
> <regressions@xxxxxxxxxxxxxxx>; Aneesh Kumar K . V
> <aneesh.kumar@xxxxxxxxxxxxx>; Sachin Sant <sachinp@xxxxxxxxxxxxx>
> Subject: Re: [PATCH] tpm: Ensure that tpm chip has ops to check if it's
> defective
>
> On Fri Jun 23, 2023 at 4:42 PM EEST, Limonciello, Mario wrote:
> >
> > On 6/23/2023 1:08 AM, Greg KH wrote:
> > > On Thu, Jun 22, 2023 at 10:04:27PM -0500, Mario Limonciello wrote:
> > >> The ibmvtpm doesn't have `chip->ops` set, and so trying to check
> > >> if it's a defective AMD fTPM doesn't work.
> > >>
> > >> Add an extra check to tpm_amd_is_rng_defective() to ensure the
> > >> TPM being checked has `chip->ops`.
> > >>
> > >> Cc: Linux regressions mailing list <regressions@xxxxxxxxxxxxxxx>
> > >> Reported-by: Aneesh Kumar K. V <aneesh.kumar@xxxxxxxxxxxxx>
> > >> Reported-by: Sachin Sant <sachinp@xxxxxxxxxxxxx>
> > >> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-
> CF832B50CAC3@xxxxxxxxxxxxx/
> > >> Tested-by: Sachin Sant <sachinp@xxxxxxxxxxxxx>
> > >> Fixes: bd8621ca1510 ("tpm: Add !tpm_amd_is_rng_defective() to the
> hwrng_unregister() call site")
> > >> Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD
> designs")
> > >> Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
> > >> ---
> > >> drivers/char/tpm/tpm-chip.c | 3 +++
> > >> 1 file changed, 3 insertions(+)
> > > No cc: stable on that list above?
> >
> > Good point, my mistake on that miss.
> >
> > If Jarkko agrees with the direction of this patch, I think
> > it can be added while committing.
>
> Hmm... sorry Midsummer weekend, which is kind of big thing in Finland,
> and also helping toe expose neo-nazi affiliated minister (sounds crazy
> but it is literally true) have made me lag a bit with LKML.
>
> I'm presuming that we are going in the direction of Jerry's patch,
> right?
>
> BR, Jarkko

Yes; let's go with Jerry's patch instead.