linux-yocto/drivers/char
Purva Yeshi 87129b9342 char: tpm: tpm-buf: Add sanity check fallback in read helpers
[ Upstream commit 32d495b384 ]

Fix Smatch-detected issue:

drivers/char/tpm/tpm-buf.c:208 tpm_buf_read_u8() error:
uninitialized symbol 'value'.
drivers/char/tpm/tpm-buf.c:225 tpm_buf_read_u16() error:
uninitialized symbol 'value'.
drivers/char/tpm/tpm-buf.c:242 tpm_buf_read_u32() error:
uninitialized symbol 'value'.

Zero-initialize the return values in tpm_buf_read_u8(), tpm_buf_read_u16(),
and tpm_buf_read_u32() to guard against uninitialized data in case of a
boundary overflow.

Add defensive initialization ensures the return values are always defined,
preventing undefined behavior if the unexpected happens.

Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-04 14:43:53 +02:00
..
agp
hw_random
ipmi ipmi: ssif_bmc: Fix new request loss when bmc ready for a response 2025-02-08 09:57:10 +01:00
mwave
tpm char: tpm: tpm-buf: Add sanity check fallback in read helpers 2025-06-04 14:43:53 +02:00
xilinx_hwicap
xillybus
adi.c vfs-6.12.file 2024-09-16 09:14:02 +02:00
apm-emulation.c
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 [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
hangcheck-timer.c
hpet.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
Kconfig
lp.c
Makefile
mem.c
misc.c char: misc: register chrdev region with all possible minors 2025-05-02 07:59:10 +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
ppdev.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
ps3flash.c
random.c random: vDSO: add __arch_get_k_vdso_rng_data() helper for data page access 2024-09-13 17:28:35 +02:00
scx200_gpio.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
sonypi.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
tlclk.c
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c virtio_console: fix missing byte order handling for cols and rows 2025-05-02 07:59:05 +02:00