diff options
author | Paul Blakey <paulb@mellanox.com> | 2020-03-18 13:50:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-01 12:01:36 +0300 |
commit | a631b96684607a387e7b47eb9874bceb3bdbc598 (patch) | |
tree | 92f817ca66e219436486ef05447d86c4c15fe4d4 /net/sched | |
parent | 312805c93bf6fda461596970a73461c3e3f73c8e (diff) | |
download | linux-a631b96684607a387e7b47eb9874bceb3bdbc598.tar.xz |
net/sched: act_ct: Fix leak of ct zone template on replace
[ Upstream commit dd2af10402684cb5840a127caec9e7cdcff6d167 ]
Currently, on replace, the previous action instance params
is swapped with a newly allocated params. The old params is
only freed (via kfree_rcu), without releasing the allocated
ct zone template related to it.
Call tcf_ct_params_free (via call_rcu) for the old params,
so it will release it.
Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_ct.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index f3232a00970f..0586546c20d7 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -739,7 +739,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, if (goto_ch) tcf_chain_put_by_act(goto_ch); if (params) - kfree_rcu(params, rcu); + call_rcu(¶ms->rcu, tcf_ct_params_free); if (res == ACT_P_CREATED) tcf_idr_insert(tn, *a); |