linux/drivers
Mario Limonciello f1324bbc40 tpm: disable hwrng for fTPM on some AMD designs
AMD has issued an advisory indicating that having fTPM enabled in
BIOS can cause "stuttering" in the OS.  This issue has been fixed
in newer versions of the fTPM firmware, but it's up to system
designers to decide whether to distribute it.

This issue has existed for a while, but is more prevalent starting
with kernel 6.1 because commit b006c439d5 ("hwrng: core - start
hwrng kthread also for untrusted sources") started to use the fTPM
for hwrng by default. However, all uses of /dev/hwrng result in
unacceptable stuttering.

So, simply disable registration of the defective hwrng when detecting
these faulty fTPM versions.  As this is caused by faulty firmware, it
is plausible that such a problem could also be reproduced by other TPM
interactions, but this hasn't been shown by any user's testing or reports.

It is hypothesized to be triggered more frequently by the use of the RNG
because userspace software will fetch random numbers regularly.

Intentionally continue to register other TPM functionality so that users
that rely upon PCR measurements or any storage of data will still have
access to it.  If it's found later that another TPM functionality is
exacerbating this problem a module parameter it can be turned off entirely
and a module parameter can be introduced to allow users who rely upon
fTPM functionality to turn it on even though this problem is present.

Link: https://www.amd.com/en/support/kb/faq/pa-410
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216989
Link: https://lore.kernel.org/all/20230209153120.261904-1-Jason@zx2c4.com/
Fixes: b006c439d5 ("hwrng: core - start hwrng kthread also for untrusted sources")
Cc: stable@vger.kernel.org
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Tested-by: reach622@mailcuk.com
Tested-by: Bell <1138267643@qq.com>
Co-developed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2023-03-12 23:28:10 +02:00
..
accel
accessibility
acpi More ACPI updates for 6.3-rc1 2023-03-03 10:36:01 -08:00
amba
android
ata ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller" 2023-03-03 18:43:02 +09:00
atm
auxdisplay
base A set of updates for the interrupt susbsystem: 2023-03-05 11:19:16 -08:00
bcma
block block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
bluetooth
bus ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
cdrom
char tpm: disable hwrng for fTPM on some AMD designs 2023-03-12 23:28:10 +02:00
clk We have one small patch to the clk core this time around. It fixes a corner 2023-02-25 15:16:23 -08:00
clocksource
comedi
connector
counter
cpufreq More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
cpuidle ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
crypto This push fixes a regression in the caam driver. 2023-03-05 11:32:30 -08:00
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
fpga
fsi
gnss
gpio
gpu Merge tag 'amd-drm-fixes-6.3-2023-03-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2023-03-10 14:17:35 +10:00
greybus
hid for-linus-2023030901 2023-03-09 10:17:23 -08:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: dev: Fix bus callback return values 2023-03-09 22:07:52 +01:00
i3c I3C for 6.3 2023-02-28 16:05:01 -08:00
idle
iio
infiniband
input ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
interconnect
iommu ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
ipack
irqchip ARM: 2023-02-25 11:30:21 -08:00
isdn
leds
macintosh
mailbox
mcb
md flexible-array transformations for 6.3-rc1 2023-02-25 12:53:42 -08:00
media media: i2c: ov2685: convert to i2c's .probe_new() 2023-03-09 21:59:04 +01:00
memory ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
memstick MMC core: 2023-02-27 09:47:26 -08:00
message
mfd Including fixes from wireless and netfilter. 2023-02-27 14:05:08 -08:00
misc misc: ad525x_dpot-i2c: Convert to i2c's .probe_new() 2023-03-09 21:58:45 +01:00
mmc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
most
mtd * regression fix for the notifier handling of the I2C core 2023-03-11 09:24:05 -08:00
mux
net Networking fixes for 6.3-rc2, including fixes from netfilter, bpf 2023-03-09 10:56:58 -08:00
nfc nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties 2023-02-28 11:48:28 +01:00
ntb
nubus
nvdimm virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
nvme block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
nvmem
of
opp
parisc
parport
pci A set of updates for the interrupt susbsystem: 2023-03-05 11:19:16 -08:00
pcmcia
peci
perf RISC-V Patches for the 6.3 Merge Window, Part 2 2023-03-03 09:32:51 -08:00
phy ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
pinctrl ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
platform platform: mellanox: mlx-platform: Initialize shift variable to 0 2023-03-07 12:08:30 +01:00
pnp
power power supply changes for the v6.3 series (part 2) 2023-03-03 16:33:28 -08:00
powercap More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Fixes for v6.3 2023-03-02 09:21:25 -08:00
remoteproc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
reset
rpmsg rpmsg updates for v6.3 2023-02-26 12:10:28 -08:00
rtc RTC for 6.3 2023-03-03 09:15:50 -08:00
s390 SCSI misc on 20230303 2023-03-03 14:41:50 -08:00
sbus
scsi SCSI fixes on 20230310 2023-03-10 20:45:53 -08:00
sh sh updates for v6.3 2023-03-01 09:44:22 -08:00
siox
slimbus
soc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
soundwire
spi spi: Fixes for v6.3 2023-03-02 09:25:38 -08:00
spmi
ssb
staging staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00
target scsi: target: iscsi: Fix an error message in iscsi_check_key() 2023-03-06 16:50:42 -05:00
tc
tee
thermal thermal: intel: int340x: processor_thermal: Fix deadlock 2023-03-03 20:34:49 +01:00
thunderbolt
tty serial: sc16is7xx: Convert to i2c's .probe_new() 2023-03-09 21:58:53 +01:00
ufs scsi: ufs: mcq: qcom: Clean the return path of ufs_qcom_mcq_config_resource() 2023-03-06 18:33:12 -05:00
uio
usb
vdpa virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
vfio VFIO updates for v6.3-rc1 2023-02-25 11:52:57 -08:00
vhost virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
video
virt virt/sev-guest: Return -EIO if certificate buffer is not large enough 2023-03-01 10:17:46 +01:00
virtio virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
vlynq
w1 w1: ds2482: Convert to i2c's .probe_new() 2023-03-09 21:58:57 +01:00
watchdog linux-watchdog 6.3-rc1 tag 2023-03-02 11:12:01 -08:00
xen
zorro
Kconfig
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00