WSL2-Linux-Kernel/drivers/powercap
Chao Qin 139bbbd011 powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue
[ Upstream commit 2d93540014 ]

When value < time_unit, the parameter of ilog2() will be zero and
the return value is -1. u64(-1) is too large for shift exponent
and then will trigger shift-out-of-bounds:

shift exponent 18446744073709551615 is too large for 32-bit type 'int'
Call Trace:
 rapl_compute_time_window_core
 rapl_write_data_raw
 set_time_window
 store_constraint_time_window_us

Signed-off-by: Chao Qin <chao.qin@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 12:35:30 +02:00
..
Kconfig powercap/drivers/dtpm: Add the experimental label to the option description 2021-03-01 17:43:29 +01:00
Makefile powercap/drivers/dtpm: Add CPU energy model based support 2020-12-22 19:50:40 +01:00
dtpm.c powercap/drivers/dtpm: Fix root node initialization 2021-03-01 17:43:29 +01:00
dtpm_cpu.c powercap/drivers/dtpm: Fix size of object being allocated 2021-01-07 18:16:03 +01:00
idle_inject.c powercap: include header to fix -Wmissing-prototypes 2020-09-25 16:46:01 +02:00
intel_rapl_common.c powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue 2022-10-26 12:35:30 +02:00
intel_rapl_msr.c powercap: Add Power Limit4 support for Alder Lake SoC 2021-08-25 20:12:16 +02:00
powercap_sys.c Merge branches 'pm-sleep', 'pm-acpi', 'pm-domains' and 'powercap' 2020-12-15 15:26:14 +01:00