Skip to content

Commit

Permalink
openvswitch: Fix skb leak in IPv6 reassembly.
Browse files Browse the repository at this point in the history
If nf_ct_frag6_gather() returns an error other than -EINPROGRESS, it
means that we still have a reference to the skb.  We should free it
before returning from handle_fragments, as stated in the comment above.

Fixes: daaa7d6 ("netfilter: ipv6: avoid nf_iterate recursion")
CC: Florian Westphal <fw@strlen.de>
CC: Pravin B Shelar <pshelar@ovn.org>
CC: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniele Di Proietto authored and David S. Miller committed Nov 30, 2016
1 parent f2ebf2a commit f92a80a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/openvswitch/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ static int handle_fragments(struct net *net, struct sw_flow_key *key,
skb_orphan(skb);
memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
err = nf_ct_frag6_gather(net, skb, user);
if (err)
if (err) {
if (err != -EINPROGRESS)
kfree_skb(skb);
return err;
}

key->ip.proto = ipv6_hdr(skb)->nexthdr;
ovs_cb.mru = IP6CB(skb)->frag_max_size;
Expand Down

0 comments on commit f92a80a

Please sign in to comment.