Skip to content

Commit 177c694

Browse files
committed
io_uring/eventfd: use ctx->rings_rcu for flags checking
Similarly to what commit e78f7b7 did for local task work additions, use ->rings_rcu under RCU rather than dereference ->rings directly. See that commit for more details. Cc: stable@vger.kernel.org Fixes: 79cfe9e ("io_uring/register: add IORING_REGISTER_RESIZE_RINGS") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 9618908 commit 177c694

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

io_uring/eventfd.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,15 @@ void io_eventfd_signal(struct io_ring_ctx *ctx, bool cqe_event)
7676
{
7777
bool skip = false;
7878
struct io_ev_fd *ev_fd;
79-
80-
if (READ_ONCE(ctx->rings->cq_flags) & IORING_CQ_EVENTFD_DISABLED)
81-
return;
79+
struct io_rings *rings;
8280

8381
guard(rcu)();
82+
83+
rings = rcu_dereference(ctx->rings_rcu);
84+
if (!rings)
85+
return;
86+
if (READ_ONCE(rings->cq_flags) & IORING_CQ_EVENTFD_DISABLED)
87+
return;
8488
ev_fd = rcu_dereference(ctx->io_ev_fd);
8589
/*
8690
* Check again if ev_fd exists in case an io_eventfd_unregister call

0 commit comments

Comments
 (0)