public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring/zcrx: fix area release on registration failure
@ 2025-05-27 17:07 Pavel Begunkov
  2025-05-27 21:33 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-05-27 17:07 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

On area registration failure there might be no ifq set and it's not safe
to access area->ifq in the release path without checking it first.

Cc: stable@vger.kernel.org
Fixes: f12ecf5e1c5ec ("io_uring/zcrx: fix late dma unmap for a dead dev")
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 b037add86793..543796da5686 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -374,7 +374,8 @@ static void io_free_rbuf_ring(struct io_zcrx_ifq *ifq)
 
 static void io_zcrx_free_area(struct io_zcrx_area *area)
 {
-	io_zcrx_unmap_area(area->ifq, area);
+	if (area->ifq)
+		io_zcrx_unmap_area(area->ifq, area);
 	io_release_area_mem(&area->mem);
 
 	kvfree(area->freelist);
-- 
2.49.0


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

* Re: [PATCH 1/1] io_uring/zcrx: fix area release on registration failure
  2025-05-27 17:07 [PATCH 1/1] io_uring/zcrx: fix area release on registration failure Pavel Begunkov
@ 2025-05-27 21:33 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-05-27 21:33 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov


On Tue, 27 May 2025 18:07:33 +0100, Pavel Begunkov wrote:
> On area registration failure there might be no ifq set and it's not safe
> to access area->ifq in the release path without checking it first.
> 
> 

Applied, thanks!

[1/1] io_uring/zcrx: fix area release on registration failure
      (no commit info)

Best regards,
-- 
Jens Axboe




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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 17:07 [PATCH 1/1] io_uring/zcrx: fix area release on registration failure Pavel Begunkov
2025-05-27 21:33 ` Jens Axboe

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