Al Viro
3035e187f3
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-05 11:46:14 +02:00
..
2018-01-01 12:45:37 -07:00
2017-11-27 13:05:09 -08:00
2018-05-30 08:17:14 +02:00
2018-02-06 14:43:37 +00:00
2018-04-24 09:43:10 +02:00
2018-01-15 12:07:54 -08:00
2017-11-02 11:10:55 +01:00
2018-05-30 08:17:29 +02:00
2018-02-11 14:34:03 -08:00
2018-05-16 10:12:30 +02:00
2018-05-16 10:12:35 +02:00
2018-02-11 14:34:03 -08:00
2017-10-19 16:15:16 +02:00
2018-02-08 11:37:31 -08:00
2018-02-01 10:51:18 -05:00
2018-02-11 14:34:03 -08:00
2018-01-31 08:48:37 -08:00
2018-02-11 14:34:03 -08:00
2018-05-30 08:17:15 +02:00
2018-02-22 10:21:02 -08:00
2017-11-27 13:05:09 -08:00
2018-02-07 14:25:22 -08:00
2018-05-30 08:17:15 +02:00
2018-05-30 08:17:30 +02:00
2018-05-30 08:17:35 +02:00
2018-02-01 08:15:25 -05:00
2018-01-15 12:07:57 -08:00
2018-05-30 08:17:23 +02:00
2018-02-11 14:34:03 -08:00
2018-05-30 08:17:37 +02:00
2017-11-27 13:05:09 -08:00
2018-05-25 16:46:11 +02:00
2017-11-02 11:10:55 +01:00
2017-12-10 12:58:18 -08:00
2018-04-19 08:54:09 +02:00
2017-11-27 13:05:09 -08:00
2018-05-01 12:47:18 -07:00
2018-05-30 08:17:15 +02:00
2018-05-30 08:17:15 +02:00
2018-02-11 14:34:03 -08:00
2018-01-24 17:33:57 -05:00
2017-11-27 13:05:09 -08:00
2018-03-15 18:57:14 -07:00
2017-11-27 16:45:11 -05:00
2018-04-19 08:54:10 +02:00
2018-05-30 08:17:15 +02:00
2017-11-02 11:10:55 +01:00
2018-04-24 09:43:09 +02:00
2018-01-01 10:09:33 -05:00
2018-05-30 08:17:23 +02:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2018-05-30 08:17:15 +02:00
2018-04-19 08:54:09 +02:00
2018-05-30 08:17:20 +02:00
2017-11-28 16:39:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-29 16:46:48 +01:00
2017-09-06 17:27:26 -07:00
2018-05-30 08:17:15 +02:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-03-19 21:14:26 -04:00
2017-11-27 13:05:09 -08:00
2018-04-24 09:42:48 +02:00
2018-05-30 08:17:41 +02:00
2018-05-30 08:17:15 +02:00
2018-06-05 11:46:10 +02:00
2018-06-05 11:46:14 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-04 19:05:15 -04:00
2017-11-17 12:54:01 -08:00
2018-02-06 18:32:45 -08:00
2017-11-02 11:10:55 +01:00
2017-10-13 16:18:33 -07:00
2017-10-03 17:54:25 -07:00
2018-02-26 09:48:42 -07:00
2018-01-31 09:25:20 -08:00
2017-11-02 11:10:55 +01:00
2017-12-28 11:17:29 -05:00
2017-11-17 11:54:55 -08:00
2018-02-03 13:49:22 -08:00
2018-05-30 08:17:15 +02:00
2018-02-26 09:05:35 -07:00
2017-11-02 11:10:55 +01:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-01-03 10:13:36 -08:00
2018-02-11 14:34:03 -08:00
2018-01-15 12:07:51 -08:00
2017-12-07 14:23:30 -05:00
2018-01-31 09:25:20 -08:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:32:44 +01:00
2018-05-16 10:12:28 +02:00
2018-02-06 18:32:47 -08:00
2017-11-10 08:48:46 -05:00
2017-11-02 11:10:55 +01:00
2018-01-29 07:27:24 -08:00
2018-02-06 10:41:33 -08:00
2017-09-10 19:31:46 -04:00
2017-11-27 13:05:09 -08:00
2018-02-08 15:18:32 -08:00
2017-11-28 13:55:01 +01:00
2018-01-09 23:57:52 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-19 08:54:12 +02:00
2018-04-24 09:43:10 +02:00
2017-12-31 16:12:23 +01:00
2017-09-05 12:53:12 +02:00
2018-02-11 14:34:03 -08:00
2018-01-02 19:27:28 -08:00
2018-02-11 14:34:03 -08:00
2017-11-17 12:08:18 -08:00
2017-11-07 10:32:44 +01:00
2018-02-11 14:34:03 -08:00
2018-01-20 02:31:15 -05:00
2018-02-22 15:00:07 -06:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2018-05-30 08:17:15 +02:00
2017-11-14 15:32:19 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2017-11-02 11:10:55 +01:00
2017-10-04 18:03:15 +11:00