[PATCH 6.19 192/342] io_uring/fdinfo: fix SQE_MIXED SQE displaying

Greg Kroah-Hartman
2026-03-31T16:39:37Z

From: Jens Axboe <axboe@kernel.dk>

[ Upstream commit b59efde9e6c122207c16169d3d0deb623956eae9 ]

When displaying pending SQEs for a MIXED ring, each 128-byte SQE
increments sq_head to skip the second slot, but the loop counter is not
adjusted. This can cause the loop to read past sq_tail by one entry for
each 128-byte SQE encountered, displaying SQEs that haven't been made
consumable yet by the application.

Match the kernel's own consumption logic in io_init_req() which
decrements what's left when consuming the extra slot.

Fixes: 1cba30bf9fdd ("io_uring: add support for IORING_SETUP_SQE_MIXED")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/fdinfo.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index 80178b69e05a2..25c92ace18bd1 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -125,6 +125,7 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
sq_idx);
break;
}
+ i++;
sqe128 = true;
}
seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, "
--
2.53.0