Skip to content

Commit

Permalink
netfilter: ip6t_REJECT: fix a dst leak in ipv6 REJECT
Browse files Browse the repository at this point in the history
We should release dst if dst->error is set.

Bug introduced in 2.6.14 by commit e104411
([XFRM]: Always release dst_entry on error in xfrm_lookup)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Eric Dumazet authored and Patrick McHardy committed Jul 2, 2010
1 parent aea9d71 commit 499031a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ipv6/netfilter/ip6t_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,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;
Expand Down

0 comments on commit 499031a

Please sign in to comment.