Skip to content

Commit bd44d7e

Browse files
isilenceaxboe
authored andcommitted
io_uring: don't allow netpolling with SETUP_IOPOLL
IORING_SETUP_IOPOLL rings don't have any netpoll handling, let's fail attempts to register netpolling in this case, there might be people who will mix up IOPOLL and netpoll. Cc: stable@vger.kernel.org Fixes: ef1186c ("io_uring: add register/unregister napi function") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/1e7553aee0a8ae4edec6742cd6dd0c1e6914fba8.1721819383.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f8b632e commit bd44d7e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io_uring/napi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ int io_register_napi(struct io_ring_ctx *ctx, void __user *arg)
222222
};
223223
struct io_uring_napi napi;
224224

225+
if (ctx->flags & IORING_SETUP_IOPOLL)
226+
return -EINVAL;
225227
if (copy_from_user(&napi, arg, sizeof(napi)))
226228
return -EFAULT;
227229
if (napi.pad[0] || napi.pad[1] || napi.pad[2] || napi.resv)

0 commit comments

Comments
 (0)