* [PATCH net 1/2] net: lapbether: ignore ops-locked netdevs
@ 2025-08-06 21:37 Stanislav Fomichev
2025-08-06 21:37 ` [PATCH net 2/2] hamradio: " Stanislav Fomichev
2025-08-08 20:50 ` [PATCH net 1/2] net: lapbether: " patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2025-08-06 21:37 UTC (permalink / raw)
To: netdev
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, ms, ast, daniel,
hawk, john.fastabend, sdf, aleksander.lobakin, linux-kernel,
linux-x25, bpf, syzbot+e67ea9c235b13b4f0020
Syzkaller managed to trigger lock dependency in xsk_notify via
register_netdevice. As discussed in [0], using register_netdevice
in the notifiers is problematic so skip adding lapbeth for ops-locked
devices.
xsk_notifier+0xa4/0x280 net/xdp/xsk.c:1645
notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2230
call_netdevice_notifiers_extack net/core/dev.c:2268 [inline]
call_netdevice_notifiers net/core/dev.c:2282 [inline]
unregister_netdevice_many_notify+0xf9d/0x2700 net/core/dev.c:12077
unregister_netdevice_many net/core/dev.c:12140 [inline]
unregister_netdevice_queue+0x305/0x3f0 net/core/dev.c:11984
register_netdevice+0x18f1/0x2270 net/core/dev.c:11149
lapbeth_new_device drivers/net/wan/lapbether.c:420 [inline]
lapbeth_device_event+0x5b1/0xbe0 drivers/net/wan/lapbether.c:462
notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2230
call_netdevice_notifiers_extack net/core/dev.c:2268 [inline]
call_netdevice_notifiers net/core/dev.c:2282 [inline]
__dev_notify_flags+0x12c/0x2e0 net/core/dev.c:9497
netif_change_flags+0x108/0x160 net/core/dev.c:9526
dev_change_flags+0xba/0x250 net/core/dev_api.c:68
devinet_ioctl+0x11d5/0x1f50 net/ipv4/devinet.c:1200
inet_ioctl+0x3a7/0x3f0 net/ipv4/af_inet.c:1001
0: https://lore.kernel.org/netdev/20250625140357.6203d0af@kernel.org/
Fixes: 4c975fd70002 ("net: hold instance lock during NETDEV_REGISTER/UP")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reported-by: syzbot+e67ea9c235b13b4f0020@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=e67ea9c235b13b4f0020
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
drivers/net/wan/lapbether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 995a7207bdf8..f357a7ac70ac 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -81,7 +81,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev)
static __inline__ int dev_is_ethdev(struct net_device *dev)
{
- return dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5);
+ return dev->type == ARPHRD_ETHER && !netdev_need_ops_lock(dev);
}
/* ------------------------------------------------------------------------ */
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net 2/2] hamradio: ignore ops-locked netdevs
2025-08-06 21:37 [PATCH net 1/2] net: lapbether: ignore ops-locked netdevs Stanislav Fomichev
@ 2025-08-06 21:37 ` Stanislav Fomichev
2025-08-08 20:50 ` [PATCH net 1/2] net: lapbether: " patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2025-08-06 21:37 UTC (permalink / raw)
To: netdev
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, ms, ast, daniel,
hawk, john.fastabend, sdf, aleksander.lobakin, linux-kernel,
linux-x25, bpf, syzbot+e6300f66a999a6612477
Syzkaller managed to trigger lock dependency in xsk_notify via
register_netdevice. As discussed in [0], using register_netdevice
in the notifiers is problematic so skip adding hamradio for ops-locked
devices.
xsk_notifier+0x89/0x230 net/xdp/xsk.c:1664
notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
unregister_netdevice_many_notify+0x14d7/0x1ff0 net/core/dev.c:12156
unregister_netdevice_many net/core/dev.c:12219 [inline]
unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12063
register_netdevice+0x1689/0x1ae0 net/core/dev.c:11241
bpq_new_device drivers/net/hamradio/bpqether.c:481 [inline]
bpq_device_event+0x491/0x600 drivers/net/hamradio/bpqether.c:523
notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
__dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1
netif_change_flags+0xe8/0x1a0 net/core/dev.c:9608
dev_change_flags+0x130/0x260 net/core/dev_api.c:68
devinet_ioctl+0xbb4/0x1b50 net/ipv4/devinet.c:1200
inet_ioctl+0x3c0/0x4c0 net/ipv4/af_inet.c:1001
0: https://lore.kernel.org/netdev/20250625140357.6203d0af@kernel.org/
Fixes: 4c975fd70002 ("net: hold instance lock during NETDEV_REGISTER/UP")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reported-by: syzbot+e6300f66a999a6612477@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=e6300f66a999a6612477
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
drivers/net/hamradio/bpqether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 0e0fe32d2da4..045c5177262e 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -138,7 +138,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev)
static inline int dev_is_ethdev(struct net_device *dev)
{
- return dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5);
+ return dev->type == ARPHRD_ETHER && !netdev_need_ops_lock(dev);
}
/* ------------------------------------------------------------------------ */
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net 1/2] net: lapbether: ignore ops-locked netdevs
2025-08-06 21:37 [PATCH net 1/2] net: lapbether: ignore ops-locked netdevs Stanislav Fomichev
2025-08-06 21:37 ` [PATCH net 2/2] hamradio: " Stanislav Fomichev
@ 2025-08-08 20:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-08 20:50 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: netdev, davem, edumazet, kuba, pabeni, andrew+netdev, ms, ast,
daniel, hawk, john.fastabend, aleksander.lobakin, linux-kernel,
linux-x25, bpf, syzbot+e67ea9c235b13b4f0020
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 6 Aug 2025 14:37:25 -0700 you wrote:
> Syzkaller managed to trigger lock dependency in xsk_notify via
> register_netdevice. As discussed in [0], using register_netdevice
> in the notifiers is problematic so skip adding lapbeth for ops-locked
> devices.
>
> xsk_notifier+0xa4/0x280 net/xdp/xsk.c:1645
> notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
> call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2230
> call_netdevice_notifiers_extack net/core/dev.c:2268 [inline]
> call_netdevice_notifiers net/core/dev.c:2282 [inline]
> unregister_netdevice_many_notify+0xf9d/0x2700 net/core/dev.c:12077
> unregister_netdevice_many net/core/dev.c:12140 [inline]
> unregister_netdevice_queue+0x305/0x3f0 net/core/dev.c:11984
> register_netdevice+0x18f1/0x2270 net/core/dev.c:11149
> lapbeth_new_device drivers/net/wan/lapbether.c:420 [inline]
> lapbeth_device_event+0x5b1/0xbe0 drivers/net/wan/lapbether.c:462
> notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
> call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2230
> call_netdevice_notifiers_extack net/core/dev.c:2268 [inline]
> call_netdevice_notifiers net/core/dev.c:2282 [inline]
> __dev_notify_flags+0x12c/0x2e0 net/core/dev.c:9497
> netif_change_flags+0x108/0x160 net/core/dev.c:9526
> dev_change_flags+0xba/0x250 net/core/dev_api.c:68
> devinet_ioctl+0x11d5/0x1f50 net/ipv4/devinet.c:1200
> inet_ioctl+0x3a7/0x3f0 net/ipv4/af_inet.c:1001
>
> [...]
Here is the summary with links:
- [net,1/2] net: lapbether: ignore ops-locked netdevs
https://git.kernel.org/netdev/net/c/53898ebabe84
- [net,2/2] hamradio: ignore ops-locked netdevs
https://git.kernel.org/netdev/net/c/c64237960819
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-08 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 21:37 [PATCH net 1/2] net: lapbether: ignore ops-locked netdevs Stanislav Fomichev
2025-08-06 21:37 ` [PATCH net 2/2] hamradio: " Stanislav Fomichev
2025-08-08 20:50 ` [PATCH net 1/2] net: lapbether: " patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).