linux/drivers/thermal
Dmitry Osipenko 3c58776827 thermal: core: Fix use-after-free in thermal_cooling_device_destroy_sysfs
This patch fixes use-after-free that was detected by KASAN. The bug is
triggered on a CPUFreq driver module unload by freeing 'cdev' on device
unregister and then using the freed structure during of the cdev's sysfs
data destruction. The solution is to unregister the sysfs at first, then
destroy sysfs data and finally release the cooling device.

Cc: <stable@vger.kernel.org> # v4.17+
Fixes: 8ea229511e ("thermal: Add cooling device's statistics in sysfs")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2018-10-10 11:44:52 +08:00
..
broadcom thermal: bcm2835: Stop using printk format %pCr 2018-06-05 09:43:38 +02:00
int340x_thermal - Error path bug fix for overflow tests (Dan) 2018-06-12 18:28:00 -07:00
qcom thermal: tsens: Fix negative temperature reporting 2018-07-27 15:16:55 -07:00
samsung thermal: samsung: Remove Exynos5440 clock handling left-overs 2018-07-27 16:21:40 -07:00
st thermal: Enhance thermal_zone_device_update for events 2016-09-27 14:35:21 +08:00
tegra - Error path bug fix for overflow tests (Dan) 2018-06-12 18:28:00 -07:00
ti-soc-thermal thermal: ti-soc-thermal: remove dead code 2018-07-27 14:43:01 -07:00
armada_thermal.c thermal: armada: fix copy-paste error in armada_thermal_probe() 2018-08-01 09:56:12 -07:00
clock_cooling.c thermal: convert clock cooling to use an IDA 2017-01-04 12:47:28 +08:00
cpu_cooling.c cpu_cooling: Drop static-power related stuff 2017-12-07 22:52:01 +01:00
da9062-thermal.c thermal: da9062/61: Thermal junction temperature monitoring driver 2017-04-06 21:48:03 -07:00
db8500_thermal.c thermal: db8500: Fix module autoload 2016-11-23 10:07:35 +08:00
devfreq_cooling.c trace: thermal: add another parameter 'power' to the tracing function 2017-05-05 15:54:45 +08:00
dove_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
fair_share.c thermal: fix source code documentation for parameters 2017-06-29 10:46:31 +08:00
gov_bang_bang.c thermal: bang-bang governor: act on lower trip boundary 2016-09-27 14:02:16 +08:00
hisi_thermal.c thermal/drivers/hisi: Remove bogus const from function return type 2018-01-02 10:44:58 -08:00
imx_thermal.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal 2018-08-16 10:21:18 -07:00
intel_bxt_pmic_thermal.c thermal: bxt: remove redundant variable trip 2017-11-02 16:29:58 +08:00
intel_pch_thermal.c thermal: pch: Add Cannon Lake support 2017-11-02 16:30:44 +08:00
intel_powerclamp.c treewide: correct "differenciate" and "instanciate" typos 2018-08-23 18:48:43 -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 thermal: Enhance thermal_zone_device_update for events 2016-09-27 14:35:21 +08: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: Translate IO-APIC GSI number to linux irq number 2018-07-26 16:02:48 +08:00
Kconfig Thermal: Intel SoC DTS: Translate IO-APIC GSI number to linux irq number 2018-07-26 16:02:48 +08:00
kirkwood_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
Makefile ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
max77620_thermal.c thermal: max77620: fix pinmux conflict on reprobe 2017-06-13 11:07:32 +02:00
mtk_thermal.c thermal: mediatek: use of_device_get_match_data() 2018-05-06 16:53:47 -07:00
of-thermal.c thermal: of-thermal: disable passive polling when thermal zone is disabled 2018-08-20 12:00:40 -07:00
power_allocator.c thermal: power_allocator: fix one race condition issue for thermal_instances list 2017-12-27 10:13:20 +08:00
qcom-spmi-temp-alarm.c thermal: qcom-spmi-temp-alarm: add support for GEN2 PMIC peripherals 2018-06-01 14:22:28 -07:00
qoriq_thermal.c thermal: qoriq: Switch to SPDX identifier 2018-08-20 11:32:55 -07:00
rcar_gen3_thermal.c thermal: rcar_gen3_thermal: convert to SPDX identifiers 2018-08-20 11:42:35 -07:00
rcar_thermal.c thermal: rcar_thermal: convert to SPDX identifiers 2018-08-20 11:35:43 -07:00
rockchip_thermal.c thermal: rockchip: Support the RV1108 SoC in thermal driver 2017-10-31 19:32:13 -07:00
spear_thermal.c thermal: spear: use __maybe_unused for PM functions 2016-02-09 14:12:08 -08:00
step_wise.c thermal/drivers/step_wise: Fix temperature regulation misbehavior 2017-10-31 19:32:17 -07:00
tango_thermal.c thermal: tango: Fix module autoload 2016-11-23 10:07:35 +08:00
thermal_core.c thermal: core: Fix use-after-free in thermal_cooling_device_destroy_sysfs 2018-10-10 11:44:52 +08:00
thermal_core.h drivers: thermal: Update license to SPDX format 2018-05-30 14:46:17 +08:00
thermal_helpers.c drivers: thermal: Update license to SPDX format 2018-05-30 14:46:17 +08:00
thermal_hwmon.c thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info 2018-07-27 14:43:21 -07:00
thermal_hwmon.h drivers: thermal: Update license to SPDX format 2018-05-30 14:46:17 +08:00
thermal_sysfs.c drivers: thermal: Update license to SPDX format 2018-05-30 14:46:17 +08:00
thermal-generic-adc.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
uniphier_thermal.c thermal: uniphier: add UniPhier PXs3 support 2018-05-06 14:46:08 -07:00
user_space.c thermal: fix source code documentation for parameters 2017-06-29 10:46:31 +08:00
x86_pkg_temp_thermal.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
zx2967_thermal.c thermal: zx2967: constify thermal_zone_of_device_ops structures 2017-08-11 11:38:30 +08:00