Commit bebd8760 authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

netfilter: ip6t_REJECT: fix a dst leak in ipv6 REJECT

commit 499031ac upstream.

We should release dst if dst->error is set.

Bug introduced in 2.6.14 by commit e104411b
([XFRM]: Always release dst_entry on error in xfrm_lookup)
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb97898f
......@@ -95,9 +95,11 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
fl.fl_ip_dport = otcph.source;
security_skb_classify_flow(oldskb, &fl);
dst = ip6_route_output(net, NULL, &fl);
if (dst == NULL)
if (dst == NULL || dst->error) {
dst_release(dst);
return;
if (dst->error || xfrm_lookup(net, &dst, &fl, NULL, 0))
}
if (xfrm_lookup(net, &dst, &fl, NULL, 0))
return;
hh_len = (dst->dev->hard_header_len + 15)&~15;
......
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