Commit 81f6a9d7 authored by Ville Nuorvala's avatar Ville Nuorvala Committed by David S. Miller

[IPV6]: Fix leaks of rt6_cow()d routes in route.c

parent 99ba7ff4
...@@ -432,6 +432,7 @@ void ip6_route_input(struct sk_buff *skb) ...@@ -432,6 +432,7 @@ void ip6_route_input(struct sk_buff *skb)
/* Race condition! In the gap, when rt6_lock was /* Race condition! In the gap, when rt6_lock was
released someone could insert this route. Relookup. released someone could insert this route. Relookup.
*/ */
dst_release(&rt->u.dst);
goto relookup; goto relookup;
} }
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
...@@ -486,6 +487,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl) ...@@ -486,6 +487,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
/* Race condition! In the gap, when rt6_lock was /* Race condition! In the gap, when rt6_lock was
released someone could insert this route. Relookup. released someone could insert this route. Relookup.
*/ */
dst_release(&rt->u.dst);
goto relookup; goto relookup;
} }
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
...@@ -1094,8 +1096,8 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr, ...@@ -1094,8 +1096,8 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
*/ */
dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires); dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires);
nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES; nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES;
dst_release(&nrt->u.dst);
} }
dst_release(&nrt->u.dst);
} else { } else {
nrt = ip6_rt_copy(rt); nrt = ip6_rt_copy(rt);
if (nrt == NULL) if (nrt == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment