Michael Ellerman
e37a469827
drivers/macintosh: Fix memleak in windfarm_pm112 driver
commit 93900337b9ac2f4eca427eff6d187be2dc3b5551 upstream.
create_cpu_loop() calls smu_sat_get_sdb_partition() which does
kmalloc() and returns the allocated buffer. In fact it's called twice,
and neither buffer is freed.
This results in a memory leak as reported by Erhard:
unreferenced object 0xc00000047081f840 (size 32):
comm "kwindfarm", pid 203, jiffies 4294880630 (age 5552.877s)
hex dump (first 32 bytes):
c8 06 02 7f ff 02 ff 01 fb bf 00 41 00 20 00 00 ...........A. ..
00 07 89 37 00 a0 00 00 00 00 00 00 00 00 00 00 ...7............
backtrace:
[<0000000083f0a65c>] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat]
[<000000003010fcb7>] .pm112_wf_notify+0x104c/0x13bc [windfarm_pm112]
[<00000000b958b2dd>] .notifier_call_chain+0xa8/0x180
[<0000000070490868>] .blocking_notifier_call_chain+0x64/0x90
[<00000000131d8149>] .wf_thread_func+0x114/0x1a0
[<000000000d54838d>] .kthread+0x13c/0x190
[<00000000669b72bc>] .ret_from_kernel_thread+0x58/0x64
unreferenced object 0xc0000004737089f0 (size 16):
comm "kwindfarm", pid 203, jiffies 4294880879 (age 5552.050s)
hex dump (first 16 bytes):
c4 04 01 7f 22 11 e0 e6 ff 55 7b 12 ec 11 00 00 ...."....U{.....
backtrace:
[<0000000083f0a65c>] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat]
[<00000000b94ef7e1>] .pm112_wf_notify+0x1294/0x13bc [windfarm_pm112]
[<00000000b958b2dd>] .notifier_call_chain+0xa8/0x180
[<0000000070490868>] .blocking_notifier_call_chain+0x64/0x90
[<00000000131d8149>] .wf_thread_func+0x114/0x1a0
[<000000000d54838d>] .kthread+0x13c/0x190
[<00000000669b72bc>] .ret_from_kernel_thread+0x58/0x64
Fix it by rearranging the logic so we deal with each buffer
separately, which then makes it easy to free the buffer once we're
done with it.
Fixes: ac171c4666 ("[PATCH] powerpc: Thermal control for dual core G5s")
Cc: stable@vger.kernel.org # v2.6.16+
Reported-by: Erhard F. <erhard_f@mailbox.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Erhard F. <erhard_f@mailbox.org>
Link: https://lore.kernel.org/r/20200423060038.3308530-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2020-06-22 09:05:29 +02:00 |
| .. |
|
ams
|
macintosh/ams-input: Use true and false for boolean values
|
2018-01-28 17:21:17 +11:00 |
|
adb-iop.c
|
macintosh/adb: Use C99 initializers for struct adb_driver instances
|
2018-03-31 00:10:32 +11:00 |
|
adb.c
|
macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver
|
2018-07-31 19:56:42 +10:00 |
|
adbhid.c
|
macintosh/adb: Properly mark continued kernel messages
|
2018-01-27 21:10:22 +11:00 |
|
ans-lcd.c
|
macintosh: Add module license to ans-lcd
|
2018-03-13 15:10:14 +11:00 |
|
ans-lcd.h
|
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
|
2017-11-02 11:10:55 +01:00 |
|
apm_emu.c
|
|
|
|
Kconfig
|
macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver
|
2018-07-31 19:56:42 +10:00 |
|
mac_hid.c
|
|
|
|
macio-adb.c
|
macintosh/adb: Use C99 initializers for struct adb_driver instances
|
2018-03-31 00:10:32 +11:00 |
|
macio_asic.c
|
powerpc/macio: set a proper dma_coherent_mask
|
2018-02-13 08:58:53 -08:00 |
|
macio_sysfs.c
|
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
|
2017-11-02 11:10:55 +01:00 |
|
Makefile
|
macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver
|
2018-07-31 19:56:42 +10:00 |
|
mediabay.c
|
|
|
|
rack-meter.c
|
drivers: macintosh: rack-meter: really fix bogus memsets
|
2018-03-31 00:10:35 +11:00 |
|
smu.c
|
vfs: do bulk POLL* -> EPOLL* replacement
|
2018-02-11 14:34:03 -08:00 |
|
therm_adt746x.c
|
macintosh: change some data types from int to bool
|
2018-01-28 17:21:09 +11:00 |
|
therm_windtunnel.c
|
macintosh: therm_windtunnel: fix regression when instantiating devices
|
2020-03-05 16:42:18 +01:00 |
|
via-cuda.c
|
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
|
2017-11-02 11:10:55 +01:00 |
|
via-macii.c
|
macintosh/adb: Use C99 initializers for struct adb_driver instances
|
2018-03-31 00:10:32 +11:00 |
|
via-pmu-backlight.c
|
backlight: Fix old-style function definition
|
2018-01-21 23:37:44 +11:00 |
|
via-pmu-event.c
|
|
|
|
via-pmu-event.h
|
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
|
2017-11-02 11:10:55 +01:00 |
|
via-pmu-led.c
|
powerpc: use the new LED disk activity trigger
|
2016-06-27 08:58:40 +02:00 |
|
via-pmu.c
|
macintosh/via-pmu: Disambiguate interrupt statistics
|
2018-07-31 19:56:43 +10:00 |
|
windfarm.h
|
windfarm: remove three exported but unused functions
|
2015-08-06 15:10:21 +10:00 |
|
windfarm_ad7417_sensor.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_core.c
|
Make static usermode helper binaries constant
|
2017-01-19 12:59:45 +01:00 |
|
windfarm_cpufreq_clamp.c
|
drivers/macintosh: Make wf_control_ops and wf_pid_param const
|
2017-08-14 21:57:56 +10:00 |
|
windfarm_fcu_controls.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_lm75_sensor.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_lm87_sensor.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_max6690_sensor.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_mpu.h
|
|
|
|
windfarm_pid.c
|
|
|
|
windfarm_pid.h
|
|
|
|
windfarm_pm72.c
|
macintosh: change some data types from int to bool
|
2018-01-28 17:21:09 +11:00 |
|
windfarm_pm81.c
|
macintosh/windfarm: fix spelling mistake: "ttarged" -> "ttarget"
|
2018-05-14 23:10:33 +10:00 |
|
windfarm_pm91.c
|
macintosh/windfarm: fix spelling mistake: "ttarged" -> "ttarget"
|
2018-05-14 23:10:33 +10:00 |
|
windfarm_pm112.c
|
drivers/macintosh: Fix memleak in windfarm_pm112 driver
|
2020-06-22 09:05:29 +02:00 |
|
windfarm_pm121.c
|
macintosh/windfarm: fix spelling mistake: "ttarged" -> "ttarget"
|
2018-05-14 23:10:33 +10:00 |
|
windfarm_rm31.c
|
macintosh: change some data types from int to bool
|
2018-01-28 17:21:09 +11:00 |
|
windfarm_smu_controls.c
|
drivers/macintosh: Make wf_control_ops and wf_pid_param const
|
2017-08-14 21:57:56 +10:00 |
|
windfarm_smu_sat.c
|
macintosh: windfarm: fix MODINFO regression
|
2020-03-18 07:14:21 +01:00 |
|
windfarm_smu_sensors.c
|
powerpc/macintosh: constify wf_sensor_ops structures
|
2017-09-01 16:42:54 +10:00 |