* [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
@ 2023-06-23 3:04 Mario Limonciello
2023-06-23 6:08 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Mario Limonciello @ 2023-06-23 3:04 UTC (permalink / raw)
To: peterhuewe, jarkko, jgg
Cc: linux-integrity, linux-kernel, Mario Limonciello,
Linux regressions mailing list, Aneesh Kumar K . V, Sachin Sant
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@lists.linux.dev>
Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3@linux.ibm.com/
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
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@amd.com>
---
drivers/char/tpm/tpm-chip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index cd48033b804a..9ba433761e9a 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -524,6 +524,9 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
u64 version;
int ret;
+ if (!chip->ops)
+ return false;
+
if (!(chip->flags & TPM_CHIP_FLAG_TPM2))
return false;
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
2023-06-23 3:04 [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective Mario Limonciello
@ 2023-06-23 6:08 ` Greg KH
2023-06-23 13:42 ` Limonciello, Mario
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2023-06-23 6:08 UTC (permalink / raw)
To: Mario Limonciello
Cc: peterhuewe, jarkko, jgg, linux-integrity, linux-kernel,
Linux regressions mailing list, Aneesh Kumar K . V, Sachin Sant
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@lists.linux.dev>
> Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3@linux.ibm.com/
> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
> 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@amd.com>
> ---
> drivers/char/tpm/tpm-chip.c | 3 +++
> 1 file changed, 3 insertions(+)
No cc: stable on that list above?
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
2023-06-23 6:08 ` Greg KH
@ 2023-06-23 13:42 ` Limonciello, Mario
2023-06-29 21:58 ` Limonciello, Mario
2023-06-30 2:08 ` Jarkko Sakkinen
0 siblings, 2 replies; 6+ messages in thread
From: Limonciello, Mario @ 2023-06-23 13:42 UTC (permalink / raw)
To: Greg KH
Cc: peterhuewe, jarkko, jgg, linux-integrity, linux-kernel,
Linux regressions mailing list, Aneesh Kumar K . V, Sachin Sant
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@lists.linux.dev>
>> Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
>> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
>> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3@linux.ibm.com/
>> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
>> 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@amd.com>
>> ---
>> 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.
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
2023-06-23 13:42 ` Limonciello, Mario
@ 2023-06-29 21:58 ` Limonciello, Mario
2023-06-30 2:08 ` Jarkko Sakkinen
1 sibling, 0 replies; 6+ messages in thread
From: Limonciello, Mario @ 2023-06-29 21:58 UTC (permalink / raw)
To: Greg KH
Cc: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
Linux regressions mailing list, Aneesh Kumar K . V, Sachin Sant
> -----Original Message-----
> From: Limonciello, Mario
> Sent: Friday, June 23, 2023 8:42 AM
> To: Greg KH <gregkh@linuxfoundation.org>
> Cc: peterhuewe@gmx.de; jarkko@kernel.org; jgg@ziepe.ca; linux-
> integrity@vger.kernel.org; linux-kernel@vger.kernel.org; Linux regressions
> mailing list <regressions@lists.linux.dev>; Aneesh Kumar K . V
> <aneesh.kumar@linux.ibm.com>; Sachin Sant <sachinp@linux.ibm.com>
> Subject: Re: [PATCH] tpm: Ensure that tpm chip has ops to check if it's
> defective
>
>
> 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@lists.linux.dev>
> >> Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
> >> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> >> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-
> CF832B50CAC3@linux.ibm.com/
> >> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
> >> 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@amd.com>
> >> ---
> >> 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.
>
> Thanks!
Since then, a much better patch was suggested.
Please discard this one.
https://lkml.org/lkml/2023/6/29/898
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
2023-06-23 13:42 ` Limonciello, Mario
2023-06-29 21:58 ` Limonciello, Mario
@ 2023-06-30 2:08 ` Jarkko Sakkinen
2023-06-30 2:31 ` Limonciello, Mario
1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-06-30 2:08 UTC (permalink / raw)
To: Limonciello, Mario, Greg KH
Cc: peterhuewe, jgg, linux-integrity, linux-kernel,
Linux regressions mailing list, Aneesh Kumar K . V, Sachin Sant
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@lists.linux.dev>
> >> Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
> >> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> >> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3@linux.ibm.com/
> >> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
> >> 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@amd.com>
> >> ---
> >> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective
2023-06-30 2:08 ` Jarkko Sakkinen
@ 2023-06-30 2:31 ` Limonciello, Mario
0 siblings, 0 replies; 6+ messages in thread
From: Limonciello, Mario @ 2023-06-30 2:31 UTC (permalink / raw)
To: Jarkko Sakkinen, Greg KH
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org, Linux regressions mailing list,
Aneesh Kumar K . V, Sachin Sant
[Public]
> -----Original Message-----
> From: Jarkko Sakkinen <jarkko@kernel.org>
> Sent: Thursday, June 29, 2023 9:09 PM
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; Greg KH
> <gregkh@linuxfoundation.org>
> Cc: peterhuewe@gmx.de; jgg@ziepe.ca; linux-integrity@vger.kernel.org; linux-
> kernel@vger.kernel.org; Linux regressions mailing list
> <regressions@lists.linux.dev>; Aneesh Kumar K . V
> <aneesh.kumar@linux.ibm.com>; Sachin Sant <sachinp@linux.ibm.com>
> 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@lists.linux.dev>
> > >> Reported-by: Aneesh Kumar K. V <aneesh.kumar@linux.ibm.com>
> > >> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> > >> Link: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-
> CF832B50CAC3@linux.ibm.com/
> > >> Tested-by: Sachin Sant <sachinp@linux.ibm.com>
> > >> 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@amd.com>
> > >> ---
> > >> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-30 2:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-23 3:04 [PATCH] tpm: Ensure that tpm chip has ops to check if it's defective Mario Limonciello
2023-06-23 6:08 ` Greg KH
2023-06-23 13:42 ` Limonciello, Mario
2023-06-29 21:58 ` Limonciello, Mario
2023-06-30 2:08 ` Jarkko Sakkinen
2023-06-30 2:31 ` Limonciello, Mario
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox