linux-stable/drivers/powercap
Chao Qin 6216b685b8 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-24 09:58:09 +02:00
..
Kconfig powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
Makefile powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm.c powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" 2022-03-01 18:59:35 +01:00
dtpm_cpu.c PM: EM: convert power field to micro-Watts precision and align drivers 2022-08-17 15:14:05 +02:00
dtpm_devfreq.c powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm_subsys.h powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
idle_inject.c powercap: fix typo in a comment in idle_inject.c 2021-12-17 16:30:19 +01:00
intel_rapl_common.c powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue 2022-10-24 09:58:09 +02:00
intel_rapl_msr.c powercap: RAPL: Add Power Limit4 support for RaptorLake 2022-05-11 19:50:11 +02:00
powercap_sys.c Merge branches 'pm-sleep', 'pm-acpi', 'pm-domains' and 'powercap' 2020-12-15 15:26:14 +01:00