]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/zcrx: check all niovs filled with dma addresses
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 16 Sep 2025 14:27:50 +0000 (15:27 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Sep 2025 18:37:20 +0000 (12:37 -0600)
Add a warning if io_populate_area_dma() can't fill in all net_iovs, it
should never happen.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index ef8d60b926465a416d3fd0ab90d3a7e123c894b1..0f15e0fa5467e84178290679d3d3d6636daaa756 100644 (file)
@@ -77,6 +77,9 @@ static int io_populate_area_dma(struct io_zcrx_ifq *ifq,
                        niov_idx++;
                }
        }
+
+       if (WARN_ON_ONCE(niov_idx != area->nia.num_niovs))
+               return -EFAULT;
        return 0;
 }