UPSTREAM: io_uring: have io_kill_timeout() honor the request references
No upstream commit exists for this patch.
Don't free the request unconditionally, if the request is issued async
then someone else may be holding a submit reference to it.
Bug: 278721720
Reported-and-tested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9ba28194ea)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I05b6b0959befa4825aba60c397a115701e9b64ee
This commit is contained in:
parent
87ed28db7d
commit
bffea4e72d
1 changed files with 2 additions and 1 deletions
|
|
@ -551,7 +551,8 @@ static void io_kill_timeout(struct io_kiocb *req)
|
|||
atomic_inc(&req->ctx->cq_timeouts);
|
||||
list_del(&req->list);
|
||||
io_cqring_fill_event(req->ctx, req->user_data, 0);
|
||||
__io_free_req(req);
|
||||
if (refcount_dec_and_test(&req->refs))
|
||||
__io_free_req(req);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue