Patch "geneve: Suppress list corruption splat in geneve_destroy_tunnels()." has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    geneve: Suppress list corruption splat in geneve_destroy_tunnels().

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     geneve-suppress-list-corruption-splat-in-geneve_dest.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fba9d42b3df703a8086f5c847ee52a6198f0fbf4
Author: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Date:   Mon Feb 17 12:37:05 2025 -0800

    geneve: Suppress list corruption splat in geneve_destroy_tunnels().
    
    [ Upstream commit 62fab6eef61f245dc8797e3a6a5b890ef40e8628 ]
    
    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: 9593172d93b9 ("geneve: Fix use-after-free in geneve_find_dev().")
    Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Link: https://patch.msgid.link/20250217203705.40342-3-kuniyu@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index a79cebd7041be..4dfe0dfb84e83 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1963,14 +1963,7 @@ static void geneve_destroy_tunnels(struct net *net, struct list_head *head)
 {
 	struct geneve_net *gn = net_generic(net, geneve_net_id);
 	struct geneve_dev *geneve, *next;
-	struct net_device *dev, *aux;
 
-	/* gather any geneve devices that were moved into this ns */
-	for_each_netdev_safe(net, dev, aux)
-		if (dev->rtnl_link_ops == &geneve_link_ops)
-			geneve_dellink(dev, head);
-
-	/* now gather any other geneve devices that were created in this ns */
 	list_for_each_entry_safe(geneve, next, &gn->geneve_list, next)
 		geneve_dellink(geneve->dev, head);
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux