public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring/zcrx: init id for xa_find
@ 2025-05-27 15:27 Pavel Begunkov
  2025-05-27 16:10 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-05-27 15:27 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

xa_find() interprets id as the lower bound and thus expects it initialised.

Reported-by: syzbot+c3ff04150c30d3df0f57@syzkaller.appspotmail.com
Fixes: 76f1cc98b23ce ("io_uring/zcrx: add support for multiple ifqs")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/zcrx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 9a568d049204..0c5b7d8f8d67 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -630,12 +630,13 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
 void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx)
 {
 	struct io_zcrx_ifq *ifq;
-	unsigned long id;
 
 	lockdep_assert_held(&ctx->uring_lock);
 
 	while (1) {
 		scoped_guard(mutex, &ctx->mmap_lock) {
+			unsigned long id = 0;
+
 			ifq = xa_find(&ctx->zcrx_ctxs, &id, ULONG_MAX, XA_PRESENT);
 			if (ifq)
 				xa_erase(&ctx->zcrx_ctxs, id);
-- 
2.49.0


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

* Re: [PATCH 1/1] io_uring/zcrx: init id for xa_find
  2025-05-27 15:27 [PATCH 1/1] io_uring/zcrx: init id for xa_find Pavel Begunkov
@ 2025-05-27 16:10 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-05-27 16:10 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov


On Tue, 27 May 2025 16:27:57 +0100, Pavel Begunkov wrote:
> xa_find() interprets id as the lower bound and thus expects it initialised.
> 
> 

Applied, thanks!

[1/1] io_uring/zcrx: init id for xa_find
      commit: eda4623cf989d033c07355be1469e44f321ce8ae

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2025-05-27 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 15:27 [PATCH 1/1] io_uring/zcrx: init id for xa_find Pavel Begunkov
2025-05-27 16:10 ` Jens Axboe

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