Skip to content

Commit 48145a5

Browse files
edumazetkuba-moo
authored andcommitted
ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu()
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: 2f17bec ("vrf: check the original netdevice for generating redirect") Signed-off-by: Eric Dumazet <[email protected]> Cc: Stephen Suryaputra <[email protected]> Reviewed-by: David Ahern <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cb6cc8e commit 48145a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/ndisc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
16941694
bool ret;
16951695

16961696
if (netif_is_l3_master(skb->dev)) {
1697-
dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif);
1697+
dev = dev_get_by_index_rcu(dev_net(skb->dev), IPCB(skb)->iif);
16981698
if (!dev)
16991699
return;
17001700
}

0 commit comments

Comments
 (0)