kernel_samsung_a53x/Documentation
Christian Marangi 5a5d3a7e42 PM / devfreq: Fix buffer overflow in trans_stat_show
commit 08e23d05fa6dc4fc13da0ccf09defdd4bbc92ff4 upstream.

Fix buffer overflow in trans_stat_show().

Convert simple snprintf to the more secure scnprintf with size of
PAGE_SIZE.

Add condition checking if we are exceeding PAGE_SIZE and exit early from
loop. Also add at the end a warning that we exceeded PAGE_SIZE and that
stats is disabled.

Return -EFBIG in the case where we don't have enough space to write the
full transition table.

Also document in the ABI that this function can return -EFBIG error.

Link: https://lore.kernel.org/all/20231024183016.14648-2-ansuelsmth@gmail.com/
Cc: stable@vger.kernel.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218041
Fixes: e552bbaf5b98 ("PM / devfreq: Add sysfs node for representing frequency transition information.")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 11:32:38 +01:00
..
ABI PM / devfreq: Fix buffer overflow in trans_stat_show 2024-11-19 11:32:38 +01:00
accounting Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
admin-guide x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled 2024-11-19 09:22:43 +01:00
arm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arm64 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
block block: introduce zone_write_granularity limit 2024-11-19 09:22:16 +01:00
bpf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cdrom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core-api Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu-freq Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dev-tools Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
device-mapper Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
devicetree dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp 2024-11-18 12:12:01 +01:00
doc-guide Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
driver-api Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fault-injection Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
features Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
filesystems rename(): fix the locking of subdirectories 2024-11-18 12:12:59 +01:00
firmware-guide Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
firmware_class Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fpga Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hwmon Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ia64 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ide Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
infiniband Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
input Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isdn Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kbuild Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kernel-hacking Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
litmus-tests Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
livepatch Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
locking Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
m68k Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
maintainer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mhi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mips Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
misc-devices Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlabel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
networking net: change accept_ra_min_rtr_lft to affect all RA lifetimes 2024-11-08 11:25:47 +01:00
nios2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvdimm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
openrisc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
parisc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
PCI Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pcmcia Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
power Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
powerpc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
process overflow: Implement size_t saturating arithmetic helpers 2024-11-18 11:42:47 +01:00
RCU Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
riscv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s390 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scheduler Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scsi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
security Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sound ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument 2024-11-18 12:13:17 +01:00
sparc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sphinx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sphinx-static Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
staging Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timers Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
translations Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
userspace-api Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
w1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
watchdog Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x86 x86/bugs: Use ALTERNATIVE() instead of mds_user_clear static key 2024-11-19 09:22:40 +01:00
xtensa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asm-annotations.rst Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic_bitops.txt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic_t.txt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Changes Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
CodingStyle Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
conf.py Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
COPYING-logo Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
docutils.conf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dontdiff Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
index.rst Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
logo.gif Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memory-barriers.txt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
SubmittingPatches Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
watch_queue.rst Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00