Pavel Begunkov 180f829fe4 io_uring: fix complete_post use ctx after free
If io_req_complete_post() put not a final ref, we can't rely on the
request's ctx ref, and so ctx may potentially be freed while
complete_post() is in io_cqring_ev_posted()/etc.

In that case get an additional ctx reference, and put it in the end, so
protecting following io_cqring_ev_posted(). And also prolong ctx
lifetime until spin_unlock happens, as we do with mutexes, so added
percpu_ref_get() doesn't race with ctx free.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-15 09:32:24 -06:00
..
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-03-05 12:21:14 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:45:25 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-27 08:29:02 -08:00
2021-03-05 17:21:25 -08:00
2021-02-24 13:38:26 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2020-09-10 14:03:31 -07:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-28 11:45:25 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-26 09:41:05 -08:00
2021-02-24 13:38:26 -08:00
2021-02-28 11:23:38 -08:00
2021-02-24 13:38:26 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:19 +01:00
2021-02-23 13:39:45 -08:00
2020-07-31 08:16:01 +02:00
2021-02-21 10:22:20 -08:00
2021-02-23 13:39:45 -08:00
2021-01-29 10:06:46 +05:30
2021-02-26 15:49:51 -07:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-24 13:38:26 -08:00
2021-01-24 14:27:20 +01:00
2020-07-31 08:16:00 +02:00
2021-01-24 14:27:19 +01:00
2021-01-21 14:06:00 -07:00
2021-02-21 11:02:48 -08:00
2021-01-24 14:27:20 +01:00
2021-02-13 17:17:53 +01:00
2020-06-09 15:40:50 -07:00
2021-01-24 14:27:18 +01:00