]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring/zcrx: assert area type in io_zcrx_iov_page
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 2 Jul 2025 14:29:08 +0000 (15:29 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 Jul 2025 17:59:56 +0000 (11:59 -0600)
Add a simple debug assertion to io_zcrx_iov_page() making it's not
trying to return pages for a dmabuf area.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/c3c30a926a18436a399a1768f3cc86c76cd17fa7.1751466461.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index 3f3c8cbde61ed5f1da2c431f6c6521a107d464ee..208d1943a9fd81ea6515e4a52b32f610ca2dcfb0 100644 (file)
@@ -44,6 +44,8 @@ static inline struct page *io_zcrx_iov_page(const struct net_iov *niov)
 {
        struct io_zcrx_area *area = io_zcrx_iov_to_area(niov);
 
+       lockdep_assert(!area->mem.is_dmabuf);
+
        return area->mem.pages[net_iov_idx(niov)];
 }