android_kernel_msm-6.1_noth.../drivers/devfreq
Christian Marangi 8a7729cda2 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-31 16:16:58 -08:00
..
event PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:51:54 +01:00
devfreq-event.c
devfreq.c PM / devfreq: Fix buffer overflow in trans_stat_show 2024-01-31 16:16:58 -08:00
exynos-bus.c OPP updates for 5.20-rc1 2022-08-03 17:49:38 +02:00
governor.h PM / devfreq: passive: Keep cpufreq_policy for possible cpus 2022-05-17 18:24:39 +09:00
governor_passive.c PM / devfreq: passive: revert an editing accident in SPDX-License line 2022-06-30 05:11:17 +09:00
governor_performance.c
governor_powersave.c
governor_simpleondemand.c
governor_userspace.c PM/devfreq: governor: Add a private governor_data for governor 2023-01-07 11:11:40 +01:00
imx-bus.c Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
imx8m-ddrc.c PM / devfreq: imx8m-ddrc: Remove unneeded of_match_ptr() 2021-04-08 13:14:51 +09:00
Kconfig PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver 2022-07-15 11:40:08 +09:00
Makefile PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver 2022-07-15 11:40:08 +09:00
mtk-cci-devfreq.c PM / devfreq: mtk-cci: Handle sram regulator probe deferral 2022-09-26 03:59:12 +09:00
rk3399_dmc.c PM / devfreq: rk3399_dmc: Block PMU during transitions 2022-05-09 03:38:07 +09:00
sun8i-a33-mbus.c PM / devfreq: Add a driver for the sun8i/sun50i MBUS 2021-12-10 15:56:07 +09:00
tegra30-devfreq.c OPP updates for 5.20-rc1 2022-08-03 17:49:38 +02:00