Ubuntu-focal-kernel/Documentation
Christian Marangi 6527af7a7f PM / devfreq: Fix buffer overflow in trans_stat_show
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: e552bbaf5b ("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>

CVE-2023-52614
(backported from commit 08e23d05fa6dc4fc13da0ccf09defdd4bbc92ff4)
[koichiroden: crafted a custom diff that suits our tree.
 The key missing commits missing from our tree are as follows:
 commit b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq struct")
 commit a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor")
 commit 483d557ee9 ("PM / devfreq: Clean up the devfreq instance name in sysfs attr")
 commit 1ebd0bc0e8 ("PM / devfreq: Move statistics to separate struct devfreq_stats")
 commit 14a3439681 ("PM / devfreq: Add clearing transitions stats")
 commit b76b3479da ("PM / devfreq: Change time stats to 64-bit")
 commit 5c0f6c7959 ("PM / devfreq: Add new interrupt_driven flag for governors")]
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Acked-by: Thibault Ferrante <thibault.ferrante@canonical.com>
Acked-by: Mehmet Basaran <mehmet.basaran@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:28 +02:00
..
ABI
EDID
PCI
RCU
accounting
admin-guide
arm
arm64
block
bpf
cdrom
cgroups
core-api
cpu-freq
crypto
dev-tools
devicetree
doc-guide
driver-api
fault-injection
fb
features
filesystems
firmware-guide
firmware_class
fpga
gpu
hid
hwmon
i2c
ia64
ide
iio
infiniband
input
ioctl
isdn
kbuild
kernel-hacking
kmsg
leds
livepatch
locking
m68k
maintainer
media
mic
mips
misc-devices
netlabel
networking
nios2
openrisc
parisc
pcmcia
power
powerpc
process
riscv
s390
scheduler
scsi
security
sh
sound
sparc
sphinx
sphinx-static
spi
target
timers
trace
translations
usb
userspace-api
virt
virtual
vm
w1
watchdog
x86
xtensa
.gitignore
COPYING-logo
Changes
CodingStyle
DMA-API-HOWTO.txt
DMA-API.txt
DMA-ISA-LPC.txt
DMA-attributes.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
Kconfig
Makefile
SubmittingPatches
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt
bus-virt-phys-mapping.txt
conf.py
crc32.txt
debugging-modules.txt
debugging-via-ohci1394.txt
digsig.txt
docutils.conf
dontdiff
futex-requeue-pi.txt
hwspinlock.txt
index.rst
io-mapping.txt
io_ordering.txt
irqflags-tracing.txt
kobject.txt
kprobes.txt
kref.txt
logo.gif
lzo.txt
mailbox.txt
memory-barriers.txt
nommu-mmap.txt
padata.txt
percpu-rw-semaphore.txt
pi-futex.txt
preempt-locking.txt
rbtree.txt
remoteproc.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
speculation.txt
static-keys.txt
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
xz.txt