summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1742.c
diff options
context:
space:
mode:
authorSven Van Asbroeck2019-04-26 20:36:35 +0200
committerAlexandre Belloni2019-04-29 15:53:43 +0200
commitf22b1ba15ee5785aa028384ebf77dd39e8e47b70 (patch)
treeed816fd34c724e615170513394ff39fe0faf4b10 /drivers/rtc/rtc-ds1742.c
parentrtc: Use dev_get_drvdata() (diff)
downloadkernel-qcow2-linux-f22b1ba15ee5785aa028384ebf77dd39e8e47b70.tar.gz
kernel-qcow2-linux-f22b1ba15ee5785aa028384ebf77dd39e8e47b70.tar.xz
kernel-qcow2-linux-f22b1ba15ee5785aa028384ebf77dd39e8e47b70.zip
rtc: 88pm860x: prevent use-after-free on device remove
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>
Diffstat (limited to 'drivers/rtc/rtc-ds1742.c')
0 files changed, 0 insertions, 0 deletions