Al Viro
914812331d
fix io_destroy()/aio_complete() race
...
commit 4faa99965e upstream.
If io_destroy() gets to cancelling everything that can be cancelled and
gets to kiocb_cancel() calling the function driver has left in ->ki_cancel,
it becomes vulnerable to a race with IO completion. At that point req
is already taken off the list and aio_complete() does *NOT* spin until
we (in free_ioctx_users()) releases ->ctx_lock. As the result, it proceeds
to kiocb_free(), freing req just it gets passed to ->ki_cancel().
Fix is simple - remove from the list after the call of kiocb_cancel(). All
instances of ->ki_cancel() already have to cope with the being called with
iocb still on list - that's what happens in io_cancel(2).
Cc: stable@kernel.org
Fixes: 0460fef2a9 "aio: use cancellation list lazily"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-06-06 16:46:23 +02:00
..
2017-11-30 08:37:22 +00:00
2018-05-30 07:48:51 +02:00
2017-12-20 10:04:56 +01:00
2018-04-24 09:32:11 +02:00
2018-05-30 07:49:09 +02:00
2015-11-16 20:38:43 -05:00
2017-12-20 10:04:52 +01:00
2018-05-30 07:48:56 +02:00
2017-11-24 08:32:25 +01:00
2017-06-26 07:13:08 +02:00
2017-08-06 19:19:42 -07:00
2016-08-16 09:30:49 +02:00
2017-09-13 14:09:45 -07:00
2018-05-30 07:48:52 +02:00
2016-03-03 15:07:09 -08:00
2015-12-12 10:15:34 -08:00
2018-05-30 07:48:52 +02:00
2018-05-30 07:48:52 +02:00
2018-05-30 07:48:52 +02:00
2017-03-15 09:57:15 +08:00
2015-08-07 13:59:24 +02:00
2018-05-30 07:49:08 +02:00
2017-11-02 09:40:49 +01:00
2018-05-30 07:49:13 +02:00
2015-09-10 13:29:01 -07:00
2018-05-26 08:49:01 +02:00
2016-09-30 10:18:39 +02:00
2016-06-01 12:15:54 -07:00
2017-06-26 07:13:11 +02:00
2017-11-30 08:37:20 +00:00
2018-05-02 07:53:38 -07:00
2018-05-30 07:48:54 +02:00
2018-05-30 07:48:52 +02:00
2018-02-16 20:09:42 +01:00
2018-05-26 08:48:50 +02:00
2015-11-06 17:50:42 -08:00
2018-03-28 18:40:15 +02:00
2018-05-30 07:48:53 +02:00
2018-02-03 17:04:28 +01:00
2018-03-24 10:58:48 +01:00
2018-05-30 07:48:52 +02:00
2018-04-24 09:32:11 +02:00
2015-11-06 17:50:42 -08:00
2018-05-30 07:49:08 +02:00
2018-04-13 19:50:14 +02:00
2018-05-30 07:49:07 +02:00
2017-08-06 19:19:43 -07:00
2018-02-03 17:04:28 +01:00
2015-10-16 11:42:28 -07:00
2018-05-30 07:48:52 +02:00
2017-06-17 06:39:38 +02:00
2015-11-13 20:34:33 -05:00
2017-04-12 12:38:33 +02:00
2015-11-23 21:11:08 -05:00
2015-11-04 22:13:45 -05:00
2018-04-24 09:32:05 +02:00
2018-05-30 07:49:15 +02:00
2018-05-30 07:48:52 +02:00
2018-06-06 16:46:20 +02:00
2018-06-06 16:46:23 +02:00
2016-10-22 12:26:56 +02:00
2015-11-10 12:07:22 -08:00
2017-07-21 07:44:57 +02:00
2017-05-20 14:27:01 +02:00
2017-06-14 13:16:24 +02:00
2015-08-05 13:49:35 -07:00
2018-02-25 11:03:51 +01:00
2018-04-08 11:51:57 +02:00
2017-07-05 14:37:20 +02:00
2015-11-16 23:54:45 -08:00
2018-05-30 07:48:52 +02:00
2017-10-18 09:20:42 +02:00
2015-08-17 18:39:46 -04:00
2017-09-07 08:34:10 +02:00
2017-07-21 07:44:57 +02:00
2018-01-31 12:06:11 +01:00
2016-04-12 09:08:58 -07:00
2015-08-07 04:39:40 +03:00
2015-11-05 23:05:32 -08:00
2018-05-16 10:06:51 +02:00
2018-02-16 20:09:38 +01:00
2015-08-17 23:38:10 -04:00
2015-11-16 23:54:45 -08:00
2015-08-12 15:28:45 -05:00
2018-01-17 09:35:27 +01:00
2015-10-15 10:33:21 -04:00
2017-07-21 07:44:57 +02:00
2017-06-14 13:16:24 +02:00
2018-04-24 09:32:04 +02:00
2018-04-24 09:32:11 +02:00
2018-02-16 20:09:43 +01:00
2017-07-15 11:57:44 +02:00
2018-05-26 08:48:51 +02:00
2017-07-21 07:44:58 +02:00
2017-04-30 05:49:28 +02:00
2017-01-26 08:23:47 +01:00
2016-04-12 09:08:55 -07:00
2017-10-05 09:41:45 +02:00
2018-01-31 12:06:09 +01:00
2017-08-06 19:19:42 -07:00
2015-08-07 04:39:40 +03:00
2017-02-23 17:43:09 +01:00
2017-06-14 13:16:24 +02:00
2018-03-03 10:19:41 +01:00
2015-11-06 17:50:42 -08:00
2017-05-08 07:46:01 +02:00
2017-12-20 10:04:53 +01:00
2016-10-22 12:26:56 +02:00
2017-10-12 11:27:32 +02:00