]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock
authorDavid Wei <dw@davidwei.uk>
Sat, 1 Nov 2025 02:24:49 +0000 (19:24 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Nov 2025 14:53:33 +0000 (07:53 -0700)
commitb6c5f9454ef34fd2753ba7843ef4d9a295c43eee
tree9a2b9ebcfa27fdfc80c31a869558cf98a22cad21
parentc07a491c1b735e0c27454ea5c27a446d43401b1e
io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock

netdev ops must be called under instance lock or rtnl_lock, but
io_register_zcrx_ifq() isn't doing this for netdev_queue_get_dma_dev().
Fix this by taking the instance lock using netdev_get_by_index_lock().

Extended the instance lock section to include attaching a memory
provider. Could not move io_zcrx_create_area() outside, since the dmabuf
codepath IORING_ZCRX_AREA_DMABUF requires ifq->dev.

Fixes: 59b8b32ac8d4 ("io_uring/zcrx: add support for custom DMA devices")
Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c