io_uring/zcrx: recheck ifq on shutdown

io_ring_exit_work() checks ifq before shutting it down and guarantees
that the pointer is stable, but instead of relying on rather complicated
synchronisation recheck the ifq pointer inside.

Reported-by: Kees Bakker <kees@ijzerbout.nl>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/905e55c47235ab26377a735294f939f31d00ae53.1739934175.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Pavel Begunkov 2025-02-19 10:08:01 +00:00 committed by Jens Axboe
parent 71082faa2c
commit bc674a04c4

View file

@ -489,9 +489,9 @@ void io_shutdown_zcrx_ifqs(struct io_ring_ctx *ctx)
{
lockdep_assert_held(&ctx->uring_lock);
if (ctx->ifq)
io_zcrx_scrub(ctx->ifq);
if (!ctx->ifq)
return;
io_zcrx_scrub(ctx->ifq);
io_close_queue(ctx->ifq);
}