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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <CUZGFNUNLO3W.1669MKELG1XIL@suppilovahvero>
Date:   Wed, 23 Aug 2023 02:16:02 +0300
From:   "Jarkko Sakkinen" <jarkko@...nel.org>
To:     "Jerry Snitselaar" <jsnitsel@...hat.com>
Cc:     <linux-sgx@...r.kernel.org>, <stable@...r.kernel.org>,
        "Todd Brandt" <todd.e.brandt@...el.com>,
        "Peter Huewe" <peterhuewe@....de>,
        "Jason Gunthorpe" <jgg@...pe.ca>,
        "Mario Limonciello" <mario.limonciello@....com>,
        <linux-integrity@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] tpm: Enable hwrng only for Pluton on AMD CPUs

On Wed Aug 23, 2023 at 12:28 AM EEST, Jerry Snitselaar wrote:
> On Tue, Aug 22, 2023 at 11:39:12PM +0300, Jarkko Sakkinen wrote:
> > The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
> > all AMD fTPMs") doesn't work properly on a number of Intel fTPMs.  On the
> > reported systems the TPM doesn't reply at bootup and returns back the
> > command code. This makes the TPM fail probe.
> > 
> > Since only Microsoft Pluton is the only known combination of AMD CPU and
> > fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin
> > aware of this, print also info message to the klog.
> > 
> > Cc: stable@...r.kernel.org
> > Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
> > Reported-by: Todd Brandt <todd.e.brandt@...el.com>
> > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
> > Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
> > ---
> > v2:
> > * CONFIG_X86
>
> Did you mean to wrap the crb_acpi_add chunk with CONFIG_X86?

Yup :-/

$ git diff
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 28448bfd4062..ea085b14ab7c 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -805,12 +805,14 @@ static int crb_acpi_add(struct acpi_device *device)
        if (rc)
                goto out;

+#ifdef CONFIG_X86
        /* A quirk for https://www.amd.com/en/support/kb/faq/pa-410 */
        if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
            priv->sm != ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON) {
                dev_info(dev, "Disabling hwrng\n");
                chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED;
        }
+#endif /* CONFIG_X86 */

        rc = tpm_chip_register(chip);

[also linux-sgx leaked by mistake to my git-send-email command line]

I sent a new one:
https://lkml.org/lkml/2023/8/22/1288

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ