Skip to content

Commit a65855e

Browse files
committed
io_uring: hold uring_lock across io_kill_timeouts() in cancel path
io_uring_try_cancel_requests() dropped ctx->uring_lock before calling io_kill_timeouts(), which walks each timeout's link chain via io_match_task() to test REQ_F_INFLIGHT. With chain mutation now serialized by ctx->uring_lock, that walk needs the lock too. Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 49ae66e commit a65855e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/cancel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ __cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
561561
ret |= io_waitid_remove_all(ctx, tctx, cancel_all);
562562
ret |= io_futex_remove_all(ctx, tctx, cancel_all);
563563
ret |= io_uring_try_cancel_uring_cmd(ctx, tctx, cancel_all);
564-
mutex_unlock(&ctx->uring_lock);
565564
ret |= io_kill_timeouts(ctx, tctx, cancel_all);
565+
mutex_unlock(&ctx->uring_lock);
566566
if (tctx)
567567
ret |= io_run_task_work() > 0;
568568
else

0 commit comments

Comments
 (0)