All of lore.kernel.org
 help / color / mirror / Atom feed
* tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
@ 2023-03-20 11:15 James Bottomley
  2023-03-20 11:22 ` James Bottomley
  2023-03-20 13:37 ` Jarkko Sakkinen
  0 siblings, 2 replies; 6+ messages in thread
From: James Bottomley @ 2023-03-20 11:15 UTC (permalink / raw)
  To: linux-integrity; +Cc: Jarkko Sakkinen, Jason A. Donenfeld, Mario Limonciello

The test for the AMD fTPM problem, which just went in, actually uses
the wrong function template for request_locality().  It's missing an
argument so the build breaks:

drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to function ‘tpm_request_locality’
  ret = tpm_request_locality(chip);
        ^~~~~~~~~~~~~~~~~~~~
drivers/char/tpm/tpm-chip.c:43:12: note: declared here
 static int tpm_request_locality(struct tpm_chip *chip, int locality)
            ^~~~~~~~~~~~~~~~~~~~

Fix this by requesting zero locality.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs")

---

diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index c04d101c7779..fee061780468 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -565,7 +565,7 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
 	if (!(chip->flags & TPM_CHIP_FLAG_TPM2))
 		return false;
 
-	ret = tpm_request_locality(chip);
+	ret = tpm_request_locality(chip, 0);
 	if (ret)
 		return false;
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
  2023-03-20 11:15 tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk James Bottomley
@ 2023-03-20 11:22 ` James Bottomley
  2023-03-20 13:47   ` Jarkko Sakkinen
  2023-03-20 13:37 ` Jarkko Sakkinen
  1 sibling, 1 reply; 6+ messages in thread
From: James Bottomley @ 2023-03-20 11:22 UTC (permalink / raw)
  To: linux-integrity; +Cc: Jarkko Sakkinen, Jason A. Donenfeld, Mario Limonciello

On Mon, 2023-03-20 at 07:15 -0400, James Bottomley wrote:
> The test for the AMD fTPM problem, which just went in, actually uses
> the wrong function template for request_locality().  It's missing an
> argument so the build breaks:
> 
> drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to
> function ‘tpm_request_locality’
>   ret = tpm_request_locality(chip);
>         ^~~~~~~~~~~~~~~~~~~~
> drivers/char/tpm/tpm-chip.c:43:12: note: declared here
>  static int tpm_request_locality(struct tpm_chip *chip, int locality)
>             ^~~~~~~~~~~~~~~~~~~~
> 
> Fix this by requesting zero locality.

Actually, this is a bad interaction with the non-upstream patch to run
the kernel in locality two to allow key policy to distinguish kernel
release from user space release, which goes back to the debate over
hibernation keys.  I'll carry it separately until (or if ever) we get a
resolution on how to do this.

James


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
  2023-03-20 11:15 tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk James Bottomley
  2023-03-20 11:22 ` James Bottomley
@ 2023-03-20 13:37 ` Jarkko Sakkinen
  1 sibling, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-03-20 13:37 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-integrity, Jason A. Donenfeld, Mario Limonciello

On Mon, Mar 20, 2023 at 07:15:52AM -0400, James Bottomley wrote:
> The test for the AMD fTPM problem, which just went in, actually uses
> the wrong function template for request_locality().  It's missing an
> argument so the build breaks:
> 
> drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to function ‘tpm_request_locality’
>   ret = tpm_request_locality(chip);
>         ^~~~~~~~~~~~~~~~~~~~
> drivers/char/tpm/tpm-chip.c:43:12: note: declared here
>  static int tpm_request_locality(struct tpm_chip *chip, int locality)
>             ^~~~~~~~~~~~~~~~~~~~
> 
> Fix this by requesting zero locality.
> 
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs")
> 
> ---
> 
> diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
> index c04d101c7779..fee061780468 100644
> --- a/drivers/char/tpm/tpm-chip.c
> +++ b/drivers/char/tpm/tpm-chip.c
> @@ -565,7 +565,7 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
>  	if (!(chip->flags & TPM_CHIP_FLAG_TPM2))
>  		return false;
>  
> -	ret = tpm_request_locality(chip);
> +	ret = tpm_request_locality(chip, 0);
>  	if (ret)
>  		return false;
>  
> 

Thank you, I sent a PR for rc4.

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
  2023-03-20 11:22 ` James Bottomley
@ 2023-03-20 13:47   ` Jarkko Sakkinen
  2023-03-23 12:20     ` James Bottomley
  0 siblings, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-03-20 13:47 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-integrity, Jason A. Donenfeld, Mario Limonciello

On Mon, Mar 20, 2023 at 07:22:52AM -0400, James Bottomley wrote:
> On Mon, 2023-03-20 at 07:15 -0400, James Bottomley wrote:
> > The test for the AMD fTPM problem, which just went in, actually uses
> > the wrong function template for request_locality().  It's missing an
> > argument so the build breaks:
> > 
> > drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to
> > function ‘tpm_request_locality’
> >   ret = tpm_request_locality(chip);
> >         ^~~~~~~~~~~~~~~~~~~~
> > drivers/char/tpm/tpm-chip.c:43:12: note: declared here
> >  static int tpm_request_locality(struct tpm_chip *chip, int locality)
> >             ^~~~~~~~~~~~~~~~~~~~
> > 
> > Fix this by requesting zero locality.
> 
> Actually, this is a bad interaction with the non-upstream patch to run
> the kernel in locality two to allow key policy to distinguish kernel
> release from user space release, which goes back to the debate over
> hibernation keys.  I'll carry it separately until (or if ever) we get a
> resolution on how to do this.

BTW, do you have a newer version of

https://lore.kernel.org/linux-integrity/20230216201410.15010-1-James.Bottomley@HansenPartnership.com/

I'm planning to flush testing queue as I have now more bandwidth
for TPM and keyring (actually I'm looking RISC-V fTPM's at work).

BR, Jarkko

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
  2023-03-20 13:47   ` Jarkko Sakkinen
@ 2023-03-23 12:20     ` James Bottomley
  2023-03-29 23:52       ` Jarkko Sakkinen
  0 siblings, 1 reply; 6+ messages in thread
From: James Bottomley @ 2023-03-23 12:20 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-integrity, Jason A. Donenfeld, Mario Limonciello

On Mon, 2023-03-20 at 15:47 +0200, Jarkko Sakkinen wrote:
> On Mon, Mar 20, 2023 at 07:22:52AM -0400, James Bottomley wrote:
> > On Mon, 2023-03-20 at 07:15 -0400, James Bottomley wrote:
> > > The test for the AMD fTPM problem, which just went in, actually
> > > uses the wrong function template for request_locality().  It's
> > > missing an argument so the build breaks:
> > > 
> > > drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to
> > > function ‘tpm_request_locality’
> > >   ret = tpm_request_locality(chip);
> > >         ^~~~~~~~~~~~~~~~~~~~
> > > drivers/char/tpm/tpm-chip.c:43:12: note: declared here
> > >  static int tpm_request_locality(struct tpm_chip *chip, int
> > > locality)
> > >             ^~~~~~~~~~~~~~~~~~~~
> > > 
> > > Fix this by requesting zero locality.
> > 
> > Actually, this is a bad interaction with the non-upstream patch to
> > run the kernel in locality two to allow key policy to distinguish
> > kernel release from user space release, which goes back to the
> > debate over hibernation keys.  I'll carry it separately until (or
> > if ever) we get a resolution on how to do this.
> 
> BTW, do you have a newer version of
> 
> https://lore.kernel.org/linux-integrity/20230216201410.15010-1-James.Bottomley@HansenPartnership.com/
> 
> I'm planning to flush testing queue as I have now more bandwidth
> for TPM and keyring (actually I'm looking RISC-V fTPM's at work).

Hopefully next week.  I'm on a business trip and conference this week,
so most of my cycles have been going into that and converting the TPM2
engine to a provider, but I'm back home next week and the provider
conversion is pretty much done.

Regards,

James


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk
  2023-03-23 12:20     ` James Bottomley
@ 2023-03-29 23:52       ` Jarkko Sakkinen
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-03-29 23:52 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-integrity, Jason A. Donenfeld, Mario Limonciello

On Thu, Mar 23, 2023 at 08:20:29AM -0400, James Bottomley wrote:
> On Mon, 2023-03-20 at 15:47 +0200, Jarkko Sakkinen wrote:
> > On Mon, Mar 20, 2023 at 07:22:52AM -0400, James Bottomley wrote:
> > > On Mon, 2023-03-20 at 07:15 -0400, James Bottomley wrote:
> > > > The test for the AMD fTPM problem, which just went in, actually
> > > > uses the wrong function template for request_locality().  It's
> > > > missing an argument so the build breaks:
> > > > 
> > > > drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to
> > > > function ‘tpm_request_locality’
> > > >   ret = tpm_request_locality(chip);
> > > >         ^~~~~~~~~~~~~~~~~~~~
> > > > drivers/char/tpm/tpm-chip.c:43:12: note: declared here
> > > >  static int tpm_request_locality(struct tpm_chip *chip, int
> > > > locality)
> > > >             ^~~~~~~~~~~~~~~~~~~~
> > > > 
> > > > Fix this by requesting zero locality.
> > > 
> > > Actually, this is a bad interaction with the non-upstream patch to
> > > run the kernel in locality two to allow key policy to distinguish
> > > kernel release from user space release, which goes back to the
> > > debate over hibernation keys.  I'll carry it separately until (or
> > > if ever) we get a resolution on how to do this.
> > 
> > BTW, do you have a newer version of
> > 
> > https://lore.kernel.org/linux-integrity/20230216201410.15010-1-James.Bottomley@HansenPartnership.com/
> > 
> > I'm planning to flush testing queue as I have now more bandwidth
> > for TPM and keyring (actually I'm looking RISC-V fTPM's at work).
> 
> Hopefully next week.  I'm on a business trip and conference this week,
> so most of my cycles have been going into that and converting the TPM2
> engine to a provider, but I'm back home next week and the provider
> conversion is pretty much done.

Yeah, as said in other reponse things have not moved because I got sick
on Friday... Anyway, I'm planning to test the current version, unless
new comes available before I get on it.

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-29 23:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 11:15 tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk James Bottomley
2023-03-20 11:22 ` James Bottomley
2023-03-20 13:47   ` Jarkko Sakkinen
2023-03-23 12:20     ` James Bottomley
2023-03-29 23:52       ` Jarkko Sakkinen
2023-03-20 13:37 ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.