From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com, netdev@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH io_uring-7.2 1/1] io_uring/zcrx: fail non-qops netdevs early
Date: Thu, 6 Aug 2026 12:42:33 +0100 [thread overview]
Message-ID: <23ae94da6725cac660652781b3533a20d0a1ad34.1786016493.git.asml.silence@gmail.com> (raw)
netdev_get_by_index_lock() might return a netdev that doesn't have qops
and also relies on rtnl. We're going to reject it later when opening a
queue, but netdev_queue_get_dma_dev() warns before that. Reject non-qops
netdevs earlier for now.
RTNL: assertion failed at ./include/net/netdev_lock.h (72)
WARNING: ./include/net/netdev_lock.h:72 at netdev_assert_locked_ops_compat
include/net/netdev_lock.h:72 [inline]
WARNING: ./include/net/netdev_lock.h:72 at netdev_queue_get_dma_dev+0x52e/0x660
net/core/netdev_queues.c:43,
RIP: 0010:netdev_assert_locked_ops_compat include/net/netdev_lock.h:72 [inline]
RIP: 0010:netdev_queue_get_dma_dev+0x53a/0x660 net/core/netdev_queues.c:43
Call Trace:
<TASK>
zcrx_register_netdev io_uring/zcrx.c:831 [inline]
io_register_zcrx+0xe94/0x1d30 io_uring/zcrx.c:983
__io_uring_register io_uring/register.c:942 [inline]
__do_sys_io_uring_register+0x1193/0x1bc0 io_uring/register.c:1040
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Cc: stable@vger.kernel.org
Fixes: b6c5f9454ef34 ("io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock")
Reported-by: syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
io_uring/zcrx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index f1464ea8ca64..add91d6d6e52 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -825,6 +825,10 @@ static int zcrx_register_netdev(struct io_zcrx_ifq *ifq,
reg->if_idx);
if (!ifq->netdev)
return -ENODEV;
+ if (!ifq->netdev->queue_mgmt_ops) {
+ ret = -EOPNOTSUPP;
+ goto netdev_put_unlock;
+ }
netdev_hold(ifq->netdev, &ifq->netdev_tracker, GFP_KERNEL);
--
2.54.0
next reply other threads:[~2026-08-06 11:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 11:42 Pavel Begunkov [this message]
[not found] ` <178601764913.2132084.3867669701970816639.b4-ty@b4>
2026-08-06 13:49 ` [PATCH io_uring-7.2 1/1] io_uring/zcrx: fail non-qops netdevs early Jakub Kicinski
2026-08-06 13:51 ` Jens Axboe
2026-08-06 14:07 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23ae94da6725cac660652781b3533a20d0a1ad34.1786016493.git.asml.silence@gmail.com \
--to=asml.silence@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox