Patch "ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu()" has been added to the 6.13-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

    ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu()

to the 6.13-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:
     ndisc-ndisc_send_redirect-must-use-dev_get_by_index_.patch
and it can be found in the queue-6.13 subdirectory.

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



commit 13a452c065e37c3d152d7b7f0135373842643273
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Fri Feb 7 13:58:33 2025 +0000

    ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu()
    
    [ Upstream commit 48145a57d4bbe3496e8e4880b23ea6b511e6e519 ]
    
    ndisc_send_redirect() is called under RCU protection, not RTNL.
    
    It must use dev_get_by_index_rcu() instead of __dev_get_by_index()
    
    Fixes: 2f17becfbea5 ("vrf: check the original netdevice for generating redirect")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: Stephen Suryaputra <ssuryaextr@xxxxxxxxx>
    Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Link: https://patch.msgid.link/20250207135841.1948589-2-edumazet@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d044c67019de6..264b10a947577 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1694,7 +1694,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
 	bool ret;
 
 	if (netif_is_l3_master(skb->dev)) {
-		dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif);
+		dev = dev_get_by_index_rcu(dev_net(skb->dev), IPCB(skb)->iif);
 		if (!dev)
 			return;
 	}




[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