From: Colin Ian King <coking@nvidia.com>
To: Jens Axboe <axboe@kernel.dk>, Keith Busch <kbusch@kernel.org>,
io-uring@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode
Date: Wed, 22 Oct 2025 14:44:31 +0100 [thread overview]
Message-ID: <20251022134431.8220-1-coking@nvidia.com> (raw)
Currently opcode is being assigned to a dereferenced pointer sqe before
sqe is being assigned. It appears the order of these two assignments cs
the wrong way around. Fix this by swapping the order of the assignments.
Fixes: 31dc41afdef2 ("io_uring: add support for IORING_SETUP_SQE_MIXED")
Signed-off-by: Colin Ian King <coking@nvidia.com>
---
io_uring/fdinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index d5aa64203de5..5b26b2a97e1b 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -100,8 +100,8 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
if (sq_idx > sq_mask)
continue;
- opcode = READ_ONCE(sqe->opcode);
sqe = &ctx->sq_sqes[sq_idx << sq_shift];
+ opcode = READ_ONCE(sqe->opcode);
if (sq_shift) {
sqe128 = true;
} else if (io_issue_defs[opcode].is_128) {
--
2.51.0
next reply other threads:[~2025-10-22 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 13:44 Colin Ian King [this message]
2025-10-22 13:46 ` [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode 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=20251022134431.8220-1-coking@nvidia.com \
--to=coking@nvidia.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@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