diff mbox series

[v1,net-next,3/3] bareudp: Call bareudp_dellink() in bareudp_destroy_tunnels().

Message ID 20250214081818.81658-4-kuniyu@amazon.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series bareudp/pfcp/ppp: Improve netns dismantle. | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-15--03-00 (tests: 891)

Commit Message

Kuniyuki Iwashima Feb. 14, 2025, 8:18 a.m. UTC
bareudp devices are destroyed in two places during netns dismantle:
bareudp_exit_batch_rtnl() and default_device_exit_batch().

bareudp_exit_batch_rtnl() unregisters devices whose backend UDP
socket is in the dying netns.

default_device_exit_batch() unregisters devices in the dying netns.

The latter calls ->dellink(), but the former calls
unregister_netdevice_queue() only.  In the former case, the device
remains in net_generic(net, bareudp_net_id)->bareudp_list.

There is no real bug, but let's call ->dellink() to avoid a potential
issue like the one recently found in geneve. [0]

Link: https://lore.kernel.org/netdev/20250213043354.91368-1-kuniyu@amazon.com/ [0]
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
 drivers/net/bareudp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 70814303aab8..396a8b28cf0c 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -780,7 +780,7 @@  static void bareudp_destroy_tunnels(struct net *net, struct list_head *head)
 	struct bareudp_dev *bareudp, *next;
 
 	list_for_each_entry_safe(bareudp, next, &bn->bareudp_list, next)
-		unregister_netdevice_queue(bareudp->dev, head);
+		bareudp_dellink(bareudp->dev, head);
 }
 
 static void __net_exit bareudp_exit_batch_rtnl(struct list_head *net_list,