Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tpmdd-v6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull more tpm updates from Jarkko Sakkinen:
"Two more bug fixes for tpm_crb, categorically disabling rng for AMD
CPU's in the tpm_crb driver, discarding the earlier probing approach"

* tag 'tpmdd-v6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
tpm: Enable hwrng only for Pluton on AMD CPUs
tpm_crb: Fix an error handling path in crb_acpi_add()

+11 -27
+11 -27
drivers/char/tpm/tpm_crb.c
··· 463 463 return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE; 464 464 } 465 465 466 - static int crb_check_flags(struct tpm_chip *chip) 467 - { 468 - u32 val; 469 - int ret; 470 - 471 - ret = crb_request_locality(chip, 0); 472 - if (ret) 473 - return ret; 474 - 475 - ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL); 476 - if (ret) 477 - goto release; 478 - 479 - if (val == 0x414D4400U /* AMD */) 480 - chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; 481 - 482 - release: 483 - crb_relinquish_locality(chip, 0); 484 - 485 - return ret; 486 - } 487 - 488 466 static const struct tpm_class_ops tpm_crb = { 489 467 .flags = TPM_OPS_AUTO_STARTUP, 490 468 .status = crb_status, ··· 775 797 FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n", 776 798 buf->header.length, 777 799 ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON); 778 - return -EINVAL; 800 + rc = -EINVAL; 801 + goto out; 779 802 } 780 803 crb_pluton = ACPI_ADD_PTR(struct tpm2_crb_pluton, buf, sizeof(*buf)); 781 804 rc = crb_map_pluton(dev, priv, buf, crb_pluton); 782 805 if (rc) 783 - return rc; 806 + goto out; 784 807 } 785 808 786 809 priv->sm = sm; ··· 805 826 if (rc) 806 827 goto out; 807 828 808 - rc = crb_check_flags(chip); 809 - if (rc) 810 - goto out; 829 + #ifdef CONFIG_X86 830 + /* A quirk for https://www.amd.com/en/support/kb/faq/pa-410 */ 831 + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && 832 + priv->sm != ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON) { 833 + dev_info(dev, "Disabling hwrng\n"); 834 + chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; 835 + } 836 + #endif /* CONFIG_X86 */ 811 837 812 838 rc = tpm_chip_register(chip); 813 839