All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tpm: disable hwrng for fTPM on some AMD designs
Date: Tue, 28 Feb 2023 04:41:03 +0200	[thread overview]
Message-ID: <Y/1pvzXqaZew20WD@kernel.org> (raw)
In-Reply-To: <DS7PR12MB60953294CDD3F198ACD3E567E2AC9@DS7PR12MB6095.namprd12.prod.outlook.com>

On Tue, Feb 28, 2023 at 02:37:59AM +0000, Limonciello, Mario wrote:
> [Public]
> 
> 
> 
> > -----Original Message-----
> > From: Limonciello, Mario
> > Sent: Monday, February 27, 2023 08:53
> > To: Peter Huewe <peterhuewe@gmx.de>; Jarkko Sakkinen
> > <jarkko@kernel.org>; Jason Gunthorpe <jgg@ziepe.ca>; Dominik Brodowski
> > <linux@dominikbrodowski.net>; Herbert Xu
> > <herbert@gondor.apana.org.au>
> > Cc: stable@vger.kernel.org; Thorsten Leemhuis
> > <regressions@leemhuis.info>; James Bottomley
> > <James.Bottomley@hansenpartnership.com>; Jason A . Donenfeld
> > <Jason@zx2c4.com>; linux-integrity@vger.kernel.org; linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH v2] tpm: disable hwrng for fTPM on some AMD designs
> > 
> > On 2/20/23 12:07, Mario Limonciello wrote:
> > > AMD has issued an advisory indicating that having fTPM enabled in
> > > BIOS can cause "stuttering" in the OS.  This issue has been fixed
> > > in newer versions of the fTPM firmware, but it's up to system
> > > designers to decide whether to distribute it.
> > >
> > > This issue has existed for a while, but is more prevalent starting
> > > with kernel 6.1 because commit b006c439d58db ("hwrng: core - start
> > > hwrng kthread also for untrusted sources") started to use the fTPM
> > > for hwrng by default. However, all uses of /dev/hwrng result in
> > > unacceptable stuttering.
> > >
> > > So, simply disable registration of the defective hwrng when detecting
> > > these faulty fTPM versions.  As this is caused by faulty firmware, it
> > > is plausible that such a problem could also be reproduced by other TPM
> > > interactions, but this hasn't been shown by any user's testing or reports.
> > >
> > > It is hypothesized to be triggered more frequently by the use of the RNG
> > > because userspace software will fetch random numbers regularly.
> > >
> > > Intentionally continue to register other TPM functionality so that users
> > > that rely upon PCR measurements or any storage of data will still have
> > > access to it.  If it's found later that another TPM functionality is
> > > exacerbating this problem a module parameter it can be turned off entirely
> > > and a module parameter can be introduced to allow users who rely upon
> > > fTPM functionality to turn it on even though this problem is present.
> > >
> > > Link: https://www.amd.com/en/support/kb/faq/pa-410
> > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216989
> > > Link: https://lore.kernel.org/all/20230209153120.261904-1-
> > Jason@zx2c4.com/
> > > Fixes: b006c439d58d ("hwrng: core - start hwrng kthread also for untrusted
> > sources")
> > > Cc: stable@vger.kernel.org
> > > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > > Cc: Thorsten Leemhuis <regressions@leemhuis.info>
> > > Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
> > > Co-developed-by: Jason A. Donenfeld <Jason@zx2c4.com>
> > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> > > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > > ---
> > > v1->v2:
> > >   * Minor style from Jarkko's feedback
> > >   * Move comment above function
> > >   * Explain further in commit message
> > 
> > One of the reporters on the kernel bugzilla did confirm the v2 patch,
> > forwarding their tag.
> > 
> > Tested-by: Bell <1138267643@qq.com>
> 
> Here's another tag.
> 
> Tested-by: reach622@mailcuk.com 

Thanks this tested-by can be in v3 because curly braces does not affect
semantics. I can ack that then and pick it up.

BR, Jarkko

  reply	other threads:[~2023-02-28  2:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 18:07 [PATCH v2] tpm: disable hwrng for fTPM on some AMD designs Mario Limonciello
2023-02-27 14:52 ` Mario Limonciello
2023-02-28  2:37   ` Limonciello, Mario
2023-02-28  2:41     ` Jarkko Sakkinen [this message]
2023-02-27 14:55 ` Guenter Roeck
2023-02-27 14:58   ` Mario Limonciello
2023-02-27 15:06     ` Guenter Roeck
2023-02-28  2:39     ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/1pvzXqaZew20WD@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=Jason@zx2c4.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=peterhuewe@gmx.de \
    --cc=regressions@leemhuis.info \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.