lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220921090600.29673-1-hbh25y@gmail.com>
Date:   Wed, 21 Sep 2022 17:06:00 +0800
From:   Hangyu Hua <hbh25y@...il.com>
To:     jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, paulb@...lanox.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hangyu Hua <hbh25y@...il.com>
Subject: [PATCH] net: sched: act_ct: fix possible refcount leak in tcf_ct_init()

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@...il.com>
---
 net/sched/act_ct.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index d55afb8d14be..3646956fc717 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -1412,6 +1412,8 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
 cleanup:
 	if (goto_ch)
 		tcf_chain_put_by_act(goto_ch);
+	if (params->tmpl)
+		nf_ct_put(params->tmpl);
 	kfree(params);
 	tcf_idr_release(*a, bind);
 	return err;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ