public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 2/6] io_uring: don't allow netpolling with SETUP_IOPOLL
Date: Wed, 24 Jul 2024 12:16:17 +0100	[thread overview]
Message-ID: <1e7553aee0a8ae4edec6742cd6dd0c1e6914fba8.1721819383.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

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: [email protected]
Fixes: ef1186c1a875b ("io_uring: add register/unregister napi function")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/napi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/io_uring/napi.c b/io_uring/napi.c
index 762254a7ff3f..327e5f3a8abe 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -222,6 +222,8 @@ int io_register_napi(struct io_ring_ctx *ctx, void __user *arg)
 	};
 	struct io_uring_napi napi;
 
+	if (ctx->flags & IORING_SETUP_IOPOLL)
+		return -EINVAL;
 	if (copy_from_user(&napi, arg, sizeof(napi)))
 		return -EFAULT;
 	if (napi.pad[0] || napi.pad[1] || napi.pad[2] || napi.resv)
-- 
2.44.0


  parent reply	other threads:[~2024-07-24 11:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 11:16 [PATCH 0/6] random fixes and patches for io_uring Pavel Begunkov
2024-07-24 11:16 ` [PATCH 1/6] io_uring: tighten task exit cancellations Pavel Begunkov
2024-07-24 11:16 ` Pavel Begunkov [this message]
2024-07-24 11:16 ` [PATCH 3/6] io_uring: fix io_match_task must_hold Pavel Begunkov
2024-07-24 11:16 ` [PATCH 4/6] io_uring: simplify io_uring_cmd return Pavel Begunkov
2024-07-24 11:16 ` [PATCH 5/6] io_uring: kill REQ_F_CANCEL_SEQ Pavel Begunkov
2024-07-24 11:16 ` [PATCH 6/6] io_uring: align iowq and task request error handling Pavel Begunkov
2024-07-24 15:52 ` [PATCH 0/6] random fixes and patches for io_uring Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e7553aee0a8ae4edec6742cd6dd0c1e6914fba8.1721819383.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox