Skip to content

Commit dd2af10

Browse files
Paul Blakeydavem330
authored andcommitted
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: b57dc7c ("net/sched: Introduce action ct") Signed-off-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2de9780 commit dd2af10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/sched/act_ct.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
739739
if (goto_ch)
740740
tcf_chain_put_by_act(goto_ch);
741741
if (params)
742-
kfree_rcu(params, rcu);
742+
call_rcu(&params->rcu, tcf_ct_params_free);
743743
if (res == ACT_P_CREATED)
744744
tcf_idr_insert(tn, *a);
745745

0 commit comments

Comments
 (0)