From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Daniil Stas <daniil.stas@posteo.net>,
James.Bottomley@hansenpartnership.com, Jason@zx2c4.com,
jarkko@kernel.org, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org, regressions@leemhuis.info,
stable@vger.kernel.org
Subject: Re: [PATCH 1/1] tpm: disable hwrng for fTPM on some AMD designs
Date: Fri, 28 Jul 2023 16:47:52 -0500 [thread overview]
Message-ID: <b157706f-b9e3-7c97-fd7c-594928d9a457@amd.com> (raw)
In-Reply-To: <CAHk-=why=_Y60iHnsh8-SZjs8Ndm41cjAHw7KX3FOD-85=CKEQ@mail.gmail.com>
On 7/28/2023 4:38 PM, Linus Torvalds wrote:
> On Fri, 28 Jul 2023 at 14:01, Limonciello, Mario
> <mario.limonciello@amd.com> wrote:
>>
>> That's exactly why I was asking in the kernel bugzilla if something
>> similar gets tripped up by RDRAND.
>
> So that would sound very unlikely, but who knows... Microcode can
> obviously do pretty much anything at all, but at least the original
> fTPM issues _seemed_ to be about BIOS doing truly crazy things like
> SPI flash accesses.
>
> I can easily imagine a BIOS fTPM code using some absolutely horrid
> global "EFI synchronization" lock or whatever, which could then cause
> random problems just based on some entirely unrelated activity.
>
> I would not be surprised, for example, if wasn't the fTPM hwrnd code
> itself that decided to read some random number from SPI, but that it
> simply got serialized with something else that the BIOS was involved
> with. It's not like BIOS people are famous for their scalable code
> that is entirely parallel...
>
> And I'd be _very_ surprised if CPU microcode does anything even
> remotely like that. Not impossible - HP famously screwed with the time
> stamp counter with SMIs, and I could imagine them - or others - doing
> the same with rdrand.
>
> But it does sound pretty damn unlikely, compared to "EFI BIOS uses a
> one big lock approach".
>
> So rdrand (and rdseed in particular) can be rather slow, but I think
> we're talking hundreds of CPU cycles (maybe low thousands). Nothing
> like the stuttering reports we've seen from fTPM.
>
> Linus
Your theory sounds totally plausible and it would explain why even
though this system has the fixes from the original issue it's tripping a
similar behavior.
Based on the argument of RDRAND being on the same SOC I think it's a
pretty good argument to drop contributing to the hwrng entropy
*anything* that's not a dTPM.
next prev parent reply other threads:[~2023-07-28 21:48 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 20:19 [PATCH 0/1] Avoid triggering an fTPM bug from kernel Mario Limonciello
2023-02-14 20:19 ` [PATCH 1/1] tpm: disable hwrng for fTPM on some AMD designs Mario Limonciello
2023-02-17 15:18 ` Thorsten Leemhuis
2023-02-17 22:35 ` Jarkko Sakkinen
2023-02-18 2:25 ` Limonciello, Mario
2023-02-21 22:53 ` Jarkko Sakkinen
2023-02-21 23:10 ` Limonciello, Mario
2023-02-27 10:57 ` Thorsten Leemhuis
2023-02-27 11:14 ` Jarkko Sakkinen
2023-02-27 11:16 ` Jarkko Sakkinen
2023-02-17 22:05 ` Jarkko Sakkinen
2023-07-27 15:38 ` Daniil Stas
2023-07-27 15:42 ` Mario Limonciello
2023-07-27 16:39 ` Daniil Stas
2023-07-27 16:41 ` Mario Limonciello
2023-07-27 16:50 ` Daniil Stas
2023-07-27 16:51 ` Mario Limonciello
2023-07-27 17:05 ` Daniil Stas
2023-07-28 20:41 ` Linus Torvalds
2023-07-28 21:01 ` Limonciello, Mario
2023-07-28 21:38 ` Linus Torvalds
2023-07-28 21:47 ` Limonciello, Mario [this message]
[not found] ` <CUGAV1Y993FB.1O2Q691015Z2C@seitikki>
2023-07-31 19:05 ` Linus Torvalds
2023-07-31 19:18 ` Limonciello, Mario
2023-07-31 19:30 ` Linus Torvalds
2023-07-31 21:57 ` Limonciello, Mario
2023-07-31 23:28 ` Linus Torvalds
2023-07-31 23:40 ` Jason A. Donenfeld
2023-08-01 3:04 ` Mario Limonciello
2023-08-01 11:36 ` Mateusz Schyboll
2023-08-01 18:52 ` Jarkko Sakkinen
2023-08-01 18:55 ` Jarkko Sakkinen
2023-08-01 18:28 ` Jarkko Sakkinen
2023-08-01 18:42 ` Linus Torvalds
2023-08-01 18:51 ` Mario Limonciello
2023-08-01 19:09 ` Jarkko Sakkinen
2023-08-02 23:13 ` Jerry Snitselaar
2023-08-03 0:34 ` Stefan Berger
2023-07-31 21:44 ` Limonciello, Mario
2023-07-28 19:30 ` Jarkko Sakkinen
2023-07-28 20:18 ` Daniil Stas
2023-07-31 10:14 ` Jarkko Sakkinen
2023-07-31 10:28 ` Daniil Stas
2023-07-31 11:07 ` 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=b157706f-b9e3-7c97-fd7c-594928d9a457@amd.com \
--to=mario.limonciello@amd.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=Jason@zx2c4.com \
--cc=daniil.stas@posteo.net \
--cc=jarkko@kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=regressions@leemhuis.info \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®