Sven Van Asbroeck
e4163587c4
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 >
2019-06-11 12:23:54 +02:00
..
2015-09-05 13:19:07 +02:00
2018-11-21 09:27:44 +01:00
2018-08-06 16:24:30 +02:00
2015-11-08 14:12:32 +01:00
2015-11-08 14:12:32 +01:00
2015-09-05 13:19:05 +02:00
2019-06-11 12:23:54 +02:00
2015-04-03 08:18:25 +02:00
2015-11-08 14:12:25 +01:00
2015-09-05 13:19:08 +02:00
2015-09-05 19:37:31 +02:00
2015-09-05 19:37:22 +02:00
2015-09-05 19:37:18 +02:00
2015-06-25 01:12:50 +02:00
2015-11-08 14:12:28 +01:00
2015-09-05 13:19:13 +02:00
2014-10-20 16:21:31 +02:00
2015-09-05 13:19:09 +02:00
2015-09-05 13:19:06 +02:00
2018-09-26 08:35:09 +02:00
2018-03-24 10:58:40 +01:00
2015-09-05 19:37:22 +02:00
2015-09-05 13:19:07 +02:00
2015-04-17 09:04:00 -04:00
2014-10-20 16:21:31 +02:00
2019-05-16 19:45:01 +02:00
2015-11-08 14:12:29 +01:00
2015-09-05 13:19:07 +02:00
2015-04-17 09:04:01 -04:00
2014-10-20 16:21:31 +02:00
2015-06-25 01:13:40 +02:00
2015-06-25 01:13:40 +02:00
2014-10-20 16:21:31 +02:00
2015-10-28 10:30:17 +09:00
2015-11-26 18:11:26 +01:00
2015-11-10 10:01:21 -08:00
2015-10-28 10:30:17 +09:00
2018-03-24 10:58:46 +01:00
2015-11-10 10:01:21 -08:00
2015-09-05 13:19:10 +02:00
2015-09-05 13:19:10 +02:00
2015-06-25 01:13:36 +02:00
2016-05-04 14:48:51 -07:00
2015-09-05 13:19:10 +02:00
2014-10-20 16:21:31 +02:00
2015-09-05 19:36:21 +02:00
2015-10-28 10:30:17 +09:00
2015-04-17 09:04:02 -04:00
2015-06-25 01:13:44 +02:00
2015-04-17 09:03:59 -04:00
2015-06-25 01:13:38 +02:00
2015-09-05 13:19:06 +02:00
2015-09-05 13:19:09 +02:00
2014-10-20 16:21:31 +02:00
2015-06-19 20:03:20 +02:00
2016-05-04 14:48:51 -07:00
2015-06-19 20:03:21 +02:00
2015-11-08 14:12:30 +01:00
2015-09-05 13:19:08 +02:00
2015-11-08 14:12:30 +01:00
2014-10-20 16:21:31 +02:00
2019-04-03 06:23:19 +02:00
2014-10-20 16:21:31 +02:00
2015-09-05 13:19:06 +02:00
2014-10-20 16:21:31 +02:00
2015-06-21 21:53:59 +02:00
2015-04-17 09:04:02 -04:00
2015-10-28 10:30:17 +09:00
2015-10-28 10:30:17 +09:00
2014-10-20 16:21:31 +02:00
2015-09-05 13:19:10 +02:00
2014-10-20 16:21:31 +02:00
2015-06-25 01:13:36 +02:00
2015-10-28 10:30:17 +09:00
2014-10-20 16:21:31 +02:00
2014-10-20 16:21:31 +02:00
2015-09-05 19:37:21 +02:00
2015-06-25 01:13:36 +02:00
2016-05-04 14:48:52 -07:00
2015-06-25 01:13:37 +02:00
2015-06-25 01:13:35 +02:00
2015-10-28 10:30:17 +09:00
2015-09-05 19:37:22 +02:00
2015-09-05 19:37:22 +02:00
2015-04-15 16:35:24 -07:00
2015-04-17 09:04:02 -04:00
2015-09-05 19:37:22 +02:00
2015-09-05 19:37:22 +02:00
2015-08-05 20:03:56 +08:00
2014-10-20 16:21:31 +02:00
2016-11-26 09:54:53 +01:00
2018-04-13 19:50:15 +02:00
2015-06-25 01:13:40 +02:00
2014-10-20 16:21:31 +02:00
2015-10-28 10:30:17 +09:00
2015-11-08 14:12:28 +01:00
2015-09-05 13:19:06 +02:00
2017-12-20 10:04:57 +01:00
2015-09-05 13:19:06 +02:00
2015-11-08 14:12:26 +01:00
2013-11-13 12:09:31 +09:00
2017-12-25 14:22:14 +01:00
2014-11-03 19:53:56 -08:00
2014-10-20 16:21:31 +02:00
2014-10-20 16:21:31 +02:00
2015-09-05 19:37:16 +02:00
2015-10-28 10:30:17 +09:00
2014-10-20 16:21:31 +02:00
2015-12-20 13:39:00 +01:00
2015-09-05 13:19:10 +02:00
2014-10-20 16:21:31 +02:00
2015-10-28 10:30:17 +09:00
2014-10-14 02:18:19 +02:00
2014-04-03 16:21:24 -07:00
2015-11-08 14:12:32 +01:00
2015-10-28 10:30:17 +09:00
2016-05-04 14:48:52 -07:00
2015-09-05 13:19:06 +02:00
2016-08-20 18:09:27 +02:00
2015-09-05 19:37:21 +02:00
2017-04-08 09:53:32 +02:00
2015-09-05 19:37:16 +02:00
2015-09-05 19:37:16 +02:00
2019-05-16 19:45:00 +02:00
2015-09-05 13:19:06 +02:00
2018-12-21 14:09:53 +01:00
2015-06-25 01:13:40 +02:00
2015-07-23 17:07:35 +01:00
2014-10-20 16:21:31 +02:00
2015-09-05 13:19:10 +02:00
2015-11-08 14:12:27 +01:00
2014-10-20 16:21:31 +02:00
2017-03-12 06:37:30 +01:00
2015-06-25 01:13:42 +02:00
2015-09-05 13:19:07 +02:00
2017-04-21 09:30:07 +02:00
2015-04-03 08:18:24 +02:00
2014-10-20 16:21:31 +02:00
2014-10-20 16:21:31 +02:00
2014-10-20 16:21:31 +02:00
2014-10-20 16:21:31 +02:00
2015-04-17 09:04:02 -04:00
2018-05-30 07:49:14 +02:00
2015-06-25 01:13:38 +02:00
2016-05-04 14:48:51 -07:00
2015-09-05 19:37:22 +02:00
2015-04-17 09:03:59 -04:00
2014-10-20 16:21:31 +02:00
2015-09-05 19:37:19 +02:00
2015-06-25 01:13:42 +02:00