Skip to content

Commit 17f8ba3

Browse files
author
CIQ Kernel Automation
committed
geneve: Suppress list corruption splat in geneve_destroy_tunnels().
jira VULN-55939 cve-bf CVE-2025-21858 commit-author Kuniyuki Iwashima <kuniyu@amazon.com> commit 62fab6e 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> (cherry picked from commit 62fab6e) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent e8fcb6d commit 17f8ba3

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

drivers/net/geneve.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,14 +1918,7 @@ static void geneve_destroy_tunnels(struct net *net, struct list_head *head)
19181918
{
19191919
struct geneve_net *gn = net_generic(net, geneve_net_id);
19201920
struct geneve_dev *geneve, *next;
1921-
struct net_device *dev, *aux;
19221921

1923-
/* gather any geneve devices that were moved into this ns */
1924-
for_each_netdev_safe(net, dev, aux)
1925-
if (dev->rtnl_link_ops == &geneve_link_ops)
1926-
geneve_dellink(dev, head);
1927-
1928-
/* now gather any other geneve devices that were created in this ns */
19291922
list_for_each_entry_safe(geneve, next, &gn->geneve_list, next)
19301923
geneve_dellink(geneve->dev, head);
19311924
}

0 commit comments

Comments
 (0)