public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode
@ 2025-10-22 13:44 Colin Ian King
  2025-10-22 13:46 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-10-22 13:44 UTC (permalink / raw)
  To: Jens Axboe, Keith Busch, io-uring; +Cc: kernel-janitors, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode
  2025-10-22 13:44 [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode Colin Ian King
@ 2025-10-22 13:46 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-10-22 13:46 UTC (permalink / raw)
  To: Colin Ian King, Keith Busch, io-uring; +Cc: kernel-janitors, linux-kernel

On 10/22/25 7:44 AM, Colin Ian King wrote:
> 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.

Fix for this has already been folded in.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-22 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 13:44 [PATCH][next] io_uring: Fix incorrect ordering of assinments of sqe and opcode Colin Ian King
2025-10-22 13:46 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox