Skip to content

Commit

Permalink
datapath: Revert "datapath: Fix template leak in error cases."
Browse files Browse the repository at this point in the history
Upstream commit:
    commit 7f6d6558ae44bc193eb28df3617c364d3bb6df39
    Author: Flavio Leitner <[email protected]>
    Date:   Fri Sep 28 14:55:34 2018 -0300

    Revert "openvswitch: Fix template leak in error cases."
    This reverts commit 90c7afc.

    When the commit was merged, the code used nf_ct_put() to free
    the entry, but later on commit 7664423 ("openvswitch: Free
    tmpl with tmpl_free.") replaced that with nf_ct_tmpl_free which
    is a more appropriate. Now the original problem is removed.

    Then 44d6e2f ("net: Replace NF_CT_ASSERT() with WARN_ON().")
    replaced a debug assert with a WARN_ON() which is trigged now.

    Signed-off-by: Flavio Leitner <[email protected]>
    Acked-by: Joe Stringer <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

This patch backports this upstream patch to OVS.

Acked-by: Flavio Leitner <[email protected]>
Signed-off-by: Yifeng Sun <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
fleitner authored and blp committed Apr 15, 2019
1 parent edf3a9c commit 50aa6e6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datapath/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,10 +1691,6 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
OVS_NLERR(log, "Failed to allocate conntrack template");
return -ENOMEM;
}

__set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status);
nf_conntrack_get(&ct_info.ct->ct_general);

if (helper) {
err = ovs_ct_add_helper(&ct_info, helper, key, log);
if (err)
Expand All @@ -1706,6 +1702,8 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
if (err)
goto err_free_ct;

__set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status);
nf_conntrack_get(&ct_info.ct->ct_general);
return 0;
err_free_ct:
__ovs_ct_free_action(&ct_info);
Expand Down

0 comments on commit 50aa6e6

Please sign in to comment.