lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Aug 2023 23:44:57 +0000
From:   "Jarkko Sakkinen" <jarkko@...nel.org>
To:     "Limonciello, Mario" <mario.limonciello@....com>
Cc:     <linux-integrity@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Thorsten Leemhuis" <regressions@...mhuis.info>,
        <charles.d.prestopine@...el.com>, <rafael.j.wysocki@...el.com>,
        <len.brown@...el.com>, <stable@...r.kernel.org>,
        "Todd Brandt" <todd.e.brandt@...el.com>
Subject: Re: [PATCH] tpm: Don't make vendor check required for probe

On Fri Aug 18, 2023 at 10:38 PM UTC, Limonciello, Mario wrote:
>
>
> On 8/18/2023 5:07 PM, Jarkko Sakkinen wrote:
> > On Fri Aug 18, 2023 at 6:15 PM UTC, Mario Limonciello wrote:
> >> The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
> >> all AMD fTPMs") doesn't work properly on Intel fTPM.  The TPM doesn't reply
> >> at bootup and returns back the command code.
> > 
> > Is this reproducible with any production hardware? You are stating it
> > as it was reproducible categorically with any Intel fTPM.
> > 
>
> Yes, it's affecting production hardware too.
> Someone came to the kernel bugzilla and reported a regression on 6.4.11 
> on a Lenovo Intel laptop as well.

Now the description says that cateogrically all Intel fTPM's fail.

I asked for the laptop model in the bugzilla bug, which should be put to
the commit description later on (hopefully with a snippet of klog
transcript). This commit cannot be applied as it is at the moment, even
if it turned out to be a legit fix.

> >> As this isn't crucial for anything but AMD fTPM and AMD fTPM works, throw
> >> away the error code to let Intel fTPM continue to work.
> >>
> >> Cc: stable@...r.kernel.org
> >> Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
> > 
> > It does make sense not to exercise this outside of AMD CPus but since
> > there is no production hardware failing, it cannot be categorized as a
> > bug fix.
>
> See above (and also kernel bugzilla).
>
> > 
> >> Reported-by: Todd Brandt <todd.e.brandt@...el.com>
> >> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
> >> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> >> ---
> >>   drivers/char/tpm/tpm_crb.c | 3 +--
> >>   1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> >> index 9eb1a18590123..b0e9931fe436c 100644
> >> --- a/drivers/char/tpm/tpm_crb.c
> >> +++ b/drivers/char/tpm/tpm_crb.c
> >> @@ -472,8 +472,7 @@ static int crb_check_flags(struct tpm_chip *chip)
> >>   	if (ret)
> >>   		return ret;
> >>   
> >> -	ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL);
> >> -	if (ret)
> >> +	if (tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL))
> >>   		goto release;
> > 
> > It would be better not to exercise a potentially failing code path at
> > all. This initiates full transaction with the TPM.
>
> So why does a full transaction not work in this case?

It makes absolutely zero sense to send a message to a TPM just to know
that you are on AMD CPU, right?

E.g. you could check if boot_cpu_data.x86_vendor == X86_VENDOR_AMD right
in the beginning of this function.

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ