1
0
Fork 0
alistair23-linux/drivers/power
Sven Van Asbroeck 03572189d6 power: supply: ltc2941-battery-gauge: fix use-after-free
commit a60ec78d30 upstream.

This driver's remove path calls cancel_delayed_work().
However, that function does not wait until the work function
finishes. This could mean that the work function is still
running after the driver's remove function has finished,
which would result in a use-after-free.

Fix by calling cancel_delayed_work_sync(), which ensures that
that the work is properly cancelled, no longer running, and
unable to re-schedule itself.

This issue was detected with the help of Coccinelle.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 04:35:24 -08:00
..
avs power: avs: smartreflex: no need to check return value of debugfs_create functions 2019-06-18 10:54:32 +02:00
reset power: reset: reboot-mode: Fix author email format 2019-09-02 21:05:59 +02:00
supply power: supply: ltc2941-battery-gauge: fix use-after-free 2020-02-11 04:35:24 -08:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00