Skip to content

Commit af14550

Browse files
committed
Merge tag 'io_uring-6.1-2022-12-08' of git://git.kernel.dk/linux
Pull io_uring fix from Jens Axboe: "A single small fix for an issue related to ordering between cancelation and current->io_uring teardown" * tag 'io_uring-6.1-2022-12-08' of git://git.kernel.dk/linux: io_uring: Fix a null-ptr-deref in io_tctx_exit_cb()
2 parents 010b676 + 998b30c commit af14550

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io_uring/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2707,8 +2707,10 @@ static __cold void io_tctx_exit_cb(struct callback_head *cb)
27072707
/*
27082708
* When @in_idle, we're in cancellation and it's racy to remove the
27092709
* node. It'll be removed by the end of cancellation, just ignore it.
2710+
* tctx can be NULL if the queueing of this task_work raced with
2711+
* work cancelation off the exec path.
27102712
*/
2711-
if (!atomic_read(&tctx->in_idle))
2713+
if (tctx && !atomic_read(&tctx->in_idle))
27122714
io_uring_del_tctx_node((unsigned long)work->ctx);
27132715
complete(&work->completion);
27142716
}

0 commit comments

Comments
 (0)