projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
815381a
)
net: sched: act_ct: fix possible refcount leak in tcf_ct_init()
author
Hangyu Hua
<hbh25y@gmail.com>
Fri, 23 Sep 2022 02:00:46 +0000
(10:00 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 5 Oct 2022 08:39:42 +0000
(10:39 +0200)
[ Upstream commit
6e23ec0ba92d426c77a73a9ccab16346e5e0ef49
]
nf_ct_put need to be called to put the refcount got by tcf_ct_fill_params
to avoid possible refcount leak when tcf_ct_flow_table_get fails.
Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link:
https://lore.kernel.org/r/20220923020046.8021-1-hbh25y@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/act_ct.c
patch
|
blob
|
history
diff --git
a/net/sched/act_ct.c
b/net/sched/act_ct.c
index f4fd584fba08a59fc688ce3114232f27283955ec..d85fdefe5730d9f753fcc4c1bd6dc967a7557d5f 100644
(file)
--- a/
net/sched/act_ct.c
+++ b/
net/sched/act_ct.c
@@
-1306,7
+1306,7
@@
static int tcf_ct_init(struct net *net, struct nlattr *nla,
err = tcf_ct_flow_table_get(params);
if (err)
- goto cleanup;
+ goto cleanup
_params
;
spin_lock_bh(&c->tcf_lock);
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
@@
-1321,6
+1321,9
@@
static int tcf_ct_init(struct net *net, struct nlattr *nla,
return res;
+cleanup_params:
+ if (params->tmpl)
+ nf_ct_put(params->tmpl);
cleanup:
if (goto_ch)
tcf_chain_put_by_act(goto_ch);