From: pavankumaryalagada@gmail.com
To: syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com
Cc: davem@davemloft.net, edumazet@google.com, horms@kernel.org,
kuba@kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, pabeni@redhat.com,
syzkaller-bugs@googlegroups.com,
Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
Subject: [PATCH] io_uring/zcrx: reject netdevices without ops lock support
Date: Wed, 5 Aug 2026 18:54:50 +0530 [thread overview]
Message-ID: <20260805132634.12646-1-pavankumaryalagada@gmail.com> (raw)
In-Reply-To: <6a71f80c.40259c87.584f4.04b9.GAE@google.com>
From: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
zcrx registration can fail for netdevices that do not support the
required ops locking model.
netdev_queue_get_dma_dev() requires ops locking support.
Calling it for devices without ops lock support triggers
netdev_assert_locked_ops_compat().
Check netdev_need_ops_lock() before accessing queue DMA information
and return -EOPNOTSUPP for unsupported devices.
Reported-by: syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=a78926bdac2adb52dc0e
Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
---
Testing:
- Verified the reported reproducer in a VM.
---
io_uring/zcrx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index f1464ea8ca64..2eba7d4e4483 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -17,6 +17,7 @@
#include <net/netdev_rx_queue.h>
#include <net/tcp.h>
#include <net/rps.h>
+#include <net/netdev_lock.h>
#include <trace/events/page_pool.h>
@@ -828,6 +829,15 @@ static int zcrx_register_netdev(struct io_zcrx_ifq *ifq,
netdev_hold(ifq->netdev, &ifq->netdev_tracker, GFP_KERNEL);
+ /*
+ * netdev_queue_get_dma_dev() requires the netdev ops locking
+ * model. Reject devices which do not support it.
+ */
+ if (!netdev_need_ops_lock(ifq->netdev)) {
+ ret = -EOPNOTSUPP;
+ goto netdev_put_unlock;
+ }
+
ifq->dev = netdev_queue_get_dma_dev(ifq->netdev, if_rxq, NETDEV_QUEUE_TYPE_RX);
if (!ifq->dev) {
ret = -EOPNOTSUPP;
--
2.43.0
prev parent reply other threads:[~2026-08-05 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 14:32 [syzbot] [net?] WARNING in netdev_queue_get_dma_dev syzbot
2026-08-04 21:00 ` Jakub Kicinski
2026-08-05 8:51 ` Pavel Begunkov
2026-08-05 13:24 ` pavankumaryalagada [this message]
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=20260805132634.12646-1-pavankumaryalagada@gmail.com \
--to=pavankumaryalagada@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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