[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <105b9d13-cedd-7d3c-1f29-2c65199f1de7@amd.com>
Date: Mon, 31 Jul 2023 14:18:21 -0500
From: "Limonciello, Mario" <mario.limonciello@....com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Jarkko Sakkinen <jarkko@...nel.org>
Cc: Daniil Stas <daniil.stas@...teo.net>,
James.Bottomley@...senpartnership.com, Jason@...c4.com,
linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
regressions@...mhuis.info, stable@...r.kernel.org
Subject: Re: [PATCH 1/1] tpm: disable hwrng for fTPM on some AMD designs
On 7/31/2023 2:05 PM, Linus Torvalds wrote:
> On Mon, 31 Jul 2023 at 03:53, Jarkko Sakkinen <jarkko@...nel.org> wrote:
>>
>> I quickly carved up a patch (attached), which is only compile tested
>> because I do not have any AMD hardware at hand.
>
> Is there some way to just see "this is a fTPM"?
>
How many fTPM implementations are there? We're talking like less than 5
right? Maybe just check against a static list when
calling tpm_add_hwrng().
> Because honestly, even if AMD is the one that has had stuttering
> issues, the bigger argument is that there is simply no _point_ in
> supporting randomness from a firmware source.
>
I've had some discussions today with a variety of people on this problem
and there is no advantage to get RNG through the fTPM over RDRAND.
They both source the exact same hardware IP, but RDRAND is a *lot* more
direct.
> There is no way anybody should believe that a firmware TPM generates
> better randomness than we do natively.
>
> And there are many reasons to _not_ believe it. The AMD problem is
> just the most user-visible one.
>
> Now, I'm not saying that a fTPM needs to be disabled in general - but
> I really feel like we should just do
>
> static int tpm_add_hwrng(struct tpm_chip *chip)
> {
> if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM))
> return 0;
> // If it's not hardware, don't treat it as such
> if (tpm_is_fTPM(chip))
> return 0;
> [...]
>
> and be done with it.
>
> But hey, if we have no way to see that whole "this is firmware
> emulation", then just blocking AMD might be the only way.
>
> Linus
Powered by blists - more mailing lists