From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com, David Wei <dw@davidwei.uk>
Subject: [PATCH v2 3/6] io_uring/zcrx: remove sqe->file_index check
Date: Sun, 20 Apr 2025 10:31:17 +0100 [thread overview]
Message-ID: <b51acedd326d1a87bf53e33303e6fc87661a3e3f.1745141261.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1745141261.git.asml.silence@gmail.com>
sqe->file_index and sqe->zcrx_ifq_idx are aliased, so even though
io_recvzc_prep() has all necessary handling and checking for
->zcrx_ifq_idx, it's already rejected a couple of lines above.
It's not a real problem, however, as we can only have one ifq at the
moment, which index is always zero, and it returns correct error
codes to the user.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
io_uring/net.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/io_uring/net.c b/io_uring/net.c
index 5f1a519d1fc6..782f8e76c5c7 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1185,8 +1185,7 @@ int io_recvzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
struct io_recvzc *zc = io_kiocb_to_cmd(req, struct io_recvzc);
unsigned ifq_idx;
- if (unlikely(sqe->file_index || sqe->addr2 || sqe->addr ||
- sqe->addr3))
+ if (unlikely(sqe->addr2 || sqe->addr || sqe->addr3))
return -EINVAL;
ifq_idx = READ_ONCE(sqe->zcrx_ifq_idx);
--
2.48.1
next prev parent reply other threads:[~2025-04-20 9:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-20 9:31 [PATCH v2 0/6] add support for multiple ifqs per io_uring Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 1/6] io_uring/zcrx: remove duplicated freelist init Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 2/6] io_uring/zcrx: move io_zcrx_iov_page Pavel Begunkov
2025-04-20 9:31 ` Pavel Begunkov [this message]
2025-04-20 9:31 ` [PATCH v2 4/6] io_uring/zcrx: let zcrx choose region for mmaping Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 5/6] io_uring/zcrx: move zcrx region to struct io_zcrx_ifq Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 6/6] io_uring/zcrx: add support for multiple ifqs Pavel Begunkov
2025-04-21 15:26 ` [PATCH v2 0/6] add support for multiple ifqs per 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=b51acedd326d1a87bf53e33303e6fc87661a3e3f.1745141261.git.asml.silence@gmail.com \
--to=asml.silence@gmail.com \
--cc=dw@davidwei.uk \
--cc=io-uring@vger.kernel.org \
/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