ipv6: call dst_hold_safe() properly
Similar as ipv4, ipv6 path also needs to call dst_hold_safe() when necessary to avoid double free issue on the dst. Signed-off-by: Wei Wang <weiwan@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9514528d92
commit
ad65a2f056
@@ -5576,8 +5576,8 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
|
||||
ip6_del_rt(rt);
|
||||
}
|
||||
if (ifp->rt) {
|
||||
dst_hold(&ifp->rt->dst);
|
||||
ip6_del_rt(ifp->rt);
|
||||
if (dst_hold_safe(&ifp->rt->dst))
|
||||
ip6_del_rt(ifp->rt);
|
||||
}
|
||||
rt_genid_bump_ipv6(net);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user