linux/drivers/thermal
Javi Merino a53b8394ec thermal: cpu_cooling: fix out of bounds access in time_in_idle
In __cpufreq_cooling_register() we allocate the arrays for time_in_idle
and time_in_idle_timestamp to be as big as the number of cpus in this
cpufreq device.  However, in get_load() we access this array using the
cpu number as index, which can result in an out of bound access.

Index time_in_idle{,_timestamp} using the index in the cpufreq_device's
allowed_cpus mask, as we do for the load_cpu array in
cpufreq_get_requested_power()

Reported-by: Nicolas Boichat <drinkcat@chromium.org>
Cc: Amit Daniel Kachhap <amit.kachhap@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2016-02-11 07:13:29 -08:00
..
int340x_thermal Thermal: Enable Broxton SoC thermal reporting device 2015-12-29 16:17:53 +08:00
samsung Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2015-11-11 09:03:01 -08:00
st Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2015-09-11 16:13:47 -07:00
ti-soc-thermal thermal: ti-soc-thermal: add OMAP36xx support 2015-09-29 14:13:19 -07:00
Kconfig thermal: allow u8500-thermal driver to be a module 2016-02-09 14:18:23 -08:00
Makefile thermal: Add devfreq cooling 2015-10-30 10:21:01 -07:00
armada_thermal.c thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula 2015-10-30 11:33:23 -07:00
clock_cooling.c thermal: introduce clock cooling device 2014-11-20 10:43:16 -04:00
cpu_cooling.c thermal: cpu_cooling: fix out of bounds access in time_in_idle 2016-02-11 07:13:29 -08:00
db8500_cpufreq_cooling.c thermal: db8500_cpufreq_cooling: Fix module autoload for OF platform driver 2015-09-13 20:26:19 -07:00
db8500_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
devfreq_cooling.c devfreq_cooling: return on allocation failure 2015-11-04 11:06:29 -08:00
dove_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
fair_share.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
gov_bang_bang.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
hisi_thermal.c Merge branches 'thermal-core' and 'thermal-intel' of .git into next 2015-09-02 10:08:02 +08:00
imx_thermal.c imx: thermal: use CPU temperature grade info for thresholds 2015-11-23 16:38:40 -08:00
intel_pch_thermal.c thermal: constify pch_dev_ops structure 2015-12-29 16:16:31 +08:00
intel_powerclamp.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2015-09-11 16:13:47 -07:00
intel_quark_dts_thermal.c x86/platform/iosf_mbi: Remove duplicate definitions 2015-12-09 01:18:34 +01:00
intel_soc_dts_iosf.c x86/platform/iosf_mbi: Remove duplicate definitions 2015-12-09 01:18:34 +01:00
intel_soc_dts_iosf.h Thermal: Intel SoC: DTS thermal IOSF core 2015-05-01 11:20:42 +08:00
intel_soc_dts_thermal.c Thermal: Intel SoC: DTS thermal use common APIs 2015-05-01 11:20:42 +08:00
kirkwood_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
of-thermal.c thermal: of: use for_each_available_child_of_node for child iterator 2016-02-09 14:01:18 -08:00
power_allocator.c thermal: power_allocator: Use temperature reading from tz 2015-11-12 10:47:24 -08:00
qcom-spmi-temp-alarm.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
rcar_thermal.c thermal: rcar: enable to use thermal-zone on DT 2016-02-09 14:05:11 -08:00
rockchip_thermal.c thermal: rockchip: Support the RK3399 SoCs in thermal driver 2016-01-06 18:06:38 -08:00
spear_thermal.c thermal: spear: use __maybe_unused for PM functions 2016-02-09 14:12:08 -08:00
step_wise.c Thermal: initialize thermal zone device correctly 2015-12-29 15:59:44 +08:00
tegra_soctherm.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
thermal_core.c Merge branches 'thermal-intel', 'thermal-suspend-fix' and 'thermal-soc' into next 2016-01-23 11:43:27 +08:00
thermal_core.h Thermal: initialize thermal zone device correctly 2015-12-29 15:59:44 +08:00
thermal_hwmon.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
thermal_hwmon.h thermal: hwmon: move hwmon support to single file 2013-09-03 09:09:12 -04:00
user_space.c Thermal: build thermal governors into thermal_sys module 2013-04-14 23:28:43 +08:00
x86_pkg_temp_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00