diff options
| author | Sven Van Asbroeck <thesven73@gmail.com> | 2019-04-26 14:36:35 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-11 12:23:54 +0200 |
| commit | e4163587c4ee0a92e99ff014e5536b85b5c6e6d0 (patch) | |
| tree | 66197db6688dab2f5f684b3c56beea1c69756338 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | a898d150956b18544af4be69c52e8e0323cd6365 (diff) | |
rtc: 88pm860x: prevent use-after-free on device remove
[ Upstream commit f22b1ba15ee5785aa028384ebf77dd39e8e47b70 ]
The device's remove() attempts to shut down the delayed_work scheduled
on the kernel-global workqueue by calling flush_scheduled_work().
Unfortunately, flush_scheduled_work() does not prevent the delayed_work
from re-scheduling itself. The delayed_work might run after the device
has been removed, and touch the already de-allocated info structure.
This is a potential use-after-free.
Fix by calling cancel_delayed_work_sync() during remove(): this ensures
that the delayed work is properly cancelled, is no longer running, and
is not able to re-schedule itself.
This issue was detected with the help of Coccinelle.
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
