Commit dd2af104 authored by Paul Blakey's avatar Paul Blakey Committed by David S. Miller

net/sched: act_ct: Fix leak of ct zone template on replace

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: b57dc7c1 ("net/sched: Introduce action ct")
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2de9780f
...@@ -739,7 +739,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, ...@@ -739,7 +739,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
if (goto_ch) if (goto_ch)
tcf_chain_put_by_act(goto_ch); tcf_chain_put_by_act(goto_ch);
if (params) if (params)
kfree_rcu(params, rcu); call_rcu(&params->rcu, tcf_ct_params_free);
if (res == ACT_P_CREATED) if (res == ACT_P_CREATED)
tcf_idr_insert(tn, *a); tcf_idr_insert(tn, *a);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment