* [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled
@ 2025-04-14 18:05 Sven Eckelmann
2025-04-14 18:41 ` Eric Dumazet
2025-04-16 3:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Sven Eckelmann @ 2025-04-14 18:05 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman
Cc: b.a.t.m.a.n, netdev, linux-kernel, syzbot+ff3aa851d46ab82953a3,
syzbot+4036165fc595a74b09b2, syzbot+c35d73ce910d86c0026e,
syzbot+48c14f61594bdfadb086, syzbot+f37372d86207b3bb2941,
Sven Eckelmann
It was originally meant to replace the dev_hold with netdev_hold. But this
was missed in batadv_hardif_enable_interface(). As result, there was an
imbalance and a hang when trying to remove the mesh-interface with
(previously) active hard-interfaces:
unregister_netdevice: waiting for batadv0 to become free. Usage count = 3
Fixes: 00b35530811f ("batman-adv: adopt netdev_hold() / netdev_put()")
Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot+ff3aa851d46ab82953a3@syzkaller.appspotmail.com
Reported-by: syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com
Reported-by: syzbot+c35d73ce910d86c0026e@syzkaller.appspotmail.com
Reported-by: syzbot+48c14f61594bdfadb086@syzkaller.appspotmail.com
Reported-by: syzbot+f37372d86207b3bb2941@syzkaller.appspotmail.com
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
This patch is skipping Simon's normal PR submission to get this problem
fixed faster in Linus' tree. This currently creates quite a lot of wrong
bisect results for syzkaller and it would be better to have this fixed
sooner than later.
---
Changes in v5:
- added Suggested-by: Eric Dumazet <edumazet@google.com>
- added Reported-by: of various syzkaller reports which were affected (during
bisecting) by this problem
- Link to v4: https://lore.kernel.org/r/20250410-double_hold_fix-v4-1-2f606fe8c204@narfation.org
Changes in v4:
- resubmission after 24h cooldown time
- added kernel message during hang to commit message
- Link to v3: https://lore.kernel.org/r/20250409073524.557189-1-sven@narfation.org
Changes in v3:
- fix submitter address
- Link to v2: https://lore.kernel.org/r/20250409073304.556841-1-sw@simonwunderlich.de
Changes in v2:
- add missing commit message
- Link to v1: https://lore.kernel.org/r/20250409073000.556263-1-sven@narfation.org
---
net/batman-adv/hard-interface.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index f145f96626531053bbf8f58a31f28f625a9d80f9..7cd4bdcee43935b9e5fb7d1696430909b7af67b4 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -725,7 +725,6 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
kref_get(&hard_iface->refcount);
- dev_hold(mesh_iface);
netdev_hold(mesh_iface, &hard_iface->meshif_dev_tracker, GFP_ATOMIC);
hard_iface->mesh_iface = mesh_iface;
bat_priv = netdev_priv(hard_iface->mesh_iface);
---
base-commit: 61f96e684edd28ca40555ec49ea1555df31ba619
change-id: 20250410-double_hold_fix-8f0a87f72ad9
Best regards,
--
Sven Eckelmann <sven@narfation.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled
2025-04-14 18:05 [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled Sven Eckelmann
@ 2025-04-14 18:41 ` Eric Dumazet
2025-04-16 3:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2025-04-14 18:41 UTC (permalink / raw)
To: Sven Eckelmann
Cc: David S. Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
b.a.t.m.a.n, netdev, linux-kernel, syzbot+ff3aa851d46ab82953a3,
syzbot+4036165fc595a74b09b2, syzbot+c35d73ce910d86c0026e,
syzbot+48c14f61594bdfadb086, syzbot+f37372d86207b3bb2941
On Mon, Apr 14, 2025 at 11:05 AM Sven Eckelmann <sven@narfation.org> wrote:
>
> It was originally meant to replace the dev_hold with netdev_hold. But this
> was missed in batadv_hardif_enable_interface(). As result, there was an
> imbalance and a hang when trying to remove the mesh-interface with
> (previously) active hard-interfaces:
>
> unregister_netdevice: waiting for batadv0 to become free. Usage count = 3
>
> Fixes: 00b35530811f ("batman-adv: adopt netdev_hold() / netdev_put()")
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot+ff3aa851d46ab82953a3@syzkaller.appspotmail.com
> Reported-by: syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com
> Reported-by: syzbot+c35d73ce910d86c0026e@syzkaller.appspotmail.com
> Reported-by: syzbot+48c14f61594bdfadb086@syzkaller.appspotmail.com
> Reported-by: syzbot+f37372d86207b3bb2941@syzkaller.appspotmail.com
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled
2025-04-14 18:05 [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled Sven Eckelmann
2025-04-14 18:41 ` Eric Dumazet
@ 2025-04-16 3:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-16 3:10 UTC (permalink / raw)
To: Sven Eckelmann
Cc: davem, edumazet, kuba, pabeni, horms, b.a.t.m.a.n, netdev,
linux-kernel, syzbot+ff3aa851d46ab82953a3,
syzbot+4036165fc595a74b09b2, syzbot+c35d73ce910d86c0026e,
syzbot+48c14f61594bdfadb086, syzbot+f37372d86207b3bb2941
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 14 Apr 2025 20:05:37 +0200 you wrote:
> It was originally meant to replace the dev_hold with netdev_hold. But this
> was missed in batadv_hardif_enable_interface(). As result, there was an
> imbalance and a hang when trying to remove the mesh-interface with
> (previously) active hard-interfaces:
>
> unregister_netdevice: waiting for batadv0 to become free. Usage count = 3
>
> [...]
Here is the summary with links:
- [net,v5] batman-adv: Fix double-hold of meshif when getting enabled
https://git.kernel.org/netdev/net/c/10a77965760c
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-04-16 3:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 18:05 [PATCH net v5] batman-adv: Fix double-hold of meshif when getting enabled Sven Eckelmann
2025-04-14 18:41 ` Eric Dumazet
2025-04-16 3:10 ` 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