Skip to content

Commit b19f127

Browse files
author
Guillaume Nault
committed
geneve: Suppress list corruption splat in geneve_destroy_tunnels().
JIRA: https://issues.redhat.com/browse/RHEL-115639 Upstream Status: linux.git commit 62fab6e Author: Kuniyuki Iwashima <kuniyu@amazon.com> Date: Mon Feb 17 12:37:05 2025 -0800 geneve: Suppress list corruption splat in geneve_destroy_tunnels(). As explained in the previous patch, iterating for_each_netdev() and gn->geneve_list during ->exit_batch_rtnl() could trigger ->dellink() twice for the same device. If CONFIG_DEBUG_LIST is enabled, we will see a list_del() corruption splat in the 2nd call of geneve_dellink(). Let's remove for_each_netdev() in geneve_destroy_tunnels() and delegate that part to default_device_exit_batch(). Fixes: 9593172 ("geneve: Fix use-after-free in geneve_find_dev().") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250217203705.40342-3-kuniyu@amazon.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Guillaume Nault <gnault@redhat.com>
1 parent 588e3f7 commit b19f127

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/net/geneve.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,14 +1859,7 @@ static void geneve_destroy_tunnels(struct net *net, struct list_head *head)
18591859
{
18601860
struct geneve_net *gn = net_generic(net, geneve_net_id);
18611861
struct geneve_dev *geneve, *next;
1862-
struct net_device *dev, *aux;
18631862

1864-
/* gather any geneve devices that were moved into this ns */
1865-
for_each_netdev_safe(net, dev, aux)
1866-
if (dev->rtnl_link_ops == &geneve_link_ops)
1867-
geneve_dellink(dev, head);
1868-
1869-
/* now gather any other geneve devices that were created in this ns */
18701863
list_for_each_entry_safe(geneve, next, &gn->geneve_list, next)
18711864
geneve_dellink(geneve->dev, head);
18721865
}

0 commit comments

Comments
 (0)