Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bffea4e7 authored by Jens Axboe's avatar Jens Axboe Committed by Treehugger Robot
Browse files

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: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9ba28194)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I05b6b0959befa4825aba60c397a115701e9b64ee
parent 87ed28db
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -551,6 +551,7 @@ 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);
		if (refcount_dec_and_test(&req->refs))
			__io_free_req(req);
	}
}