mirror-linux/drivers/char
Denis Aleksandrov a29ad21b98 tpm: Prevent local DOS via tpm/tpm0/ppi/*operations
Reads on tpm/tpm0/ppi/*operations can become very long on
misconfigured systems. Reading the TPM is a blocking operation,
thus a user could effectively trigger a DOS.

Resolve this by caching the results and avoiding the blocking
operations after the first read.

[ jarkko: fixed atomic sleep:
  sed -i 's/spin_/mutex_/g' drivers/char/tpm/tpm_ppi.c
  sed -i 's/DEFINE_SPINLOCK/DEFINE_MUTEX/g' drivers/char/tpm/tpm_ppi.c ]

Signed-off-by: Denis Aleksandrov <daleksan@redhat.com>
Reported-by: Jan Stancek <jstancek@redhat.com>
Closes: https://lore.kernel.org/linux-integrity/20250915210829.6661-1-daleksan@redhat.com/T/#u
Suggested-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2025-10-10 08:21:45 +03:00
..
agp agp/amd64: Check AGP Capability before binding to unsupported devices 2025-07-09 07:23:09 +02:00
hw_random This update includes the following changes: 2025-10-04 14:59:29 -07:00
ipmi ipmi: Add Loongson-2K BMC support 2025-09-16 10:15:54 -05:00
mwave
tpm tpm: Prevent local DOS via tpm/tpm0/ppi/*operations 2025-10-10 08:21:45 +03:00
xilinx_hwicap char: Switch back to struct platform_driver::remove() 2024-11-05 05:33:47 +01:00
xillybus char: xillybus: Use to_delayed_work() 2025-04-17 10:56:11 +02:00
Kconfig drivers: char: SONYPI depends on HAS_IOPORT 2025-06-24 16:44:19 +01:00
Makefile char: misc: Move drivers/misc/misc_minor_kunit.c to drivers/char/ 2025-08-19 12:41:17 +02:00
adi.c char/adi: Remove redundant less-than-zero check in adi_write() 2025-09-06 16:00:36 +02:00
apm-emulation.c apm-emulation: hide an unused variable 2025-04-17 10:56:11 +02:00
applicom.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
applicom.h
bsr.c
ds1620.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
dsp56k.c
dtlk.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hangcheck-timer.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hpet.c hpet: Use str_plural() to simplify the code 2025-08-19 12:50:36 +02:00
lp.c
mem.c /dev/zero: try to align PMD_SIZE for private mapping 2025-09-13 16:54:42 -07:00
misc.c char: Use list_del_init() in misc_deregister() to reinitialize list pointer 2025-09-06 19:43:18 +02:00
misc_minor_kunit.c char: misc: Add a case to test registering miscdevice again without reinitialization 2025-08-19 12:41:17 +02:00
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
powernv-op-panel.c char: Switch back to struct platform_driver::remove() 2024-11-05 05:33:47 +01:00
ppdev.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
ps3flash.c
random.c lib/ratelimit: Reduce false-positive and silent misses 2025-05-27 10:48:36 -07:00
scx200_gpio.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
sonypi.c sonypi: Use str_on_off() helper in sonypi_display_info() 2025-02-20 15:25:09 +01:00
tlclk.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c virtio_console: fix order of fields cols and rows 2025-04-18 10:08:11 -04:00