linux-kernelorg-stable/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
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
xillybus
Kconfig
Makefile
adi.c char/adi: Remove redundant less-than-zero check in adi_write() 2025-09-06 16:00:36 +02:00
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
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
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c
ps3flash.c
random.c
scx200_gpio.c
sonypi.c
tlclk.c
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c