From: Ming Lei <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Cc: Ming Lei <[email protected]>, [email protected]
Subject: [PATCH V2 1/2] io_uring: fail NOP if non-zero op flags is passed in
Date: Fri, 10 May 2024 11:50:27 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
The NOP op flags should have been checked from beginning like any other
opcode, otherwise NOP may not be extended with the op flags.
Given both liburing and Rust io-uring crate always zeros SQE op flags, just
ignore users which play raw NOP uring interface without zeroing SQE, because
NOP is just for test purpose. Then we can save one NOP2 opcode.
Suggested-by: Jens Axboe <[email protected]>
Fixes: 2b188cc1bb85 ("Add io_uring IO interface")
Cc: [email protected]
Signed-off-by: Ming Lei <[email protected]>
---
io_uring/nop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/io_uring/nop.c b/io_uring/nop.c
index d956599a3c1b..1a4e312dfe51 100644
--- a/io_uring/nop.c
+++ b/io_uring/nop.c
@@ -12,6 +12,8 @@
int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
+ if (READ_ONCE(sqe->rw_flags))
+ return -EINVAL;
return 0;
}
--
2.42.0
next prev parent reply other threads:[~2024-05-10 3:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 3:50 [PATCH V2 0/2] io_uring: support to inject result for NOP Ming Lei
2024-05-10 3:50 ` Ming Lei [this message]
2024-05-10 3:50 ` [PATCH V2 2/2] " Ming Lei
2024-05-10 12:50 ` [PATCH V2 0/2] " 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 \
[email protected] \
[email protected] \
[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