commit f92a80a9972175a6a1d36c6c44be47fb0efd020d
    Author: Daniele Di Proietto <[email protected]>
    Date:   Mon Nov 28 15:43:53 2016 -0800

    openvswitch: Fix skb leak in IPv6 reassembly.

    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: daaa7d647f81 ("netfilter: ipv6: avoid nf_iterate recursion")
    CC: Florian Westphal <[email protected]>
    CC: Pravin B Shelar <[email protected]>
    CC: Joe Stringer <[email protected]>
    Signed-off-by: Daniele Di Proietto <[email protected]>
    Acked-by: Pravin B Shelar <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

VMware-BZ: #1728498
Fixes: 2e602ea3dafa("compat: nf_defrag_ipv6: avoid nf_iterate recursion.")
Signed-off-by: Daniele Di Proietto <[email protected]>
---
 datapath/conntrack.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 6e722b6..d942884 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -424,8 +424,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.dp_cb.mru = IP6CB(skb)->frag_max_size;
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to