From: Florian Westphal <fw@strlen.de>
To: <netdev@vger.kernel.org>
Cc: netfilter-devel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Florian Westphal <fw@strlen.de>
Subject: [PATCH net 3/5] netfilter: nf_tables: fix percpu memory leak at nf_tables_addchain()
Date: Wed, 21 Sep 2022 09:38:23 +0200 [thread overview]
Message-ID: <20220921073825.4658-4-fw@strlen.de> (raw)
In-Reply-To: <20220921073825.4658-1-fw@strlen.de>
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
It seems to me that percpu memory for chain stats started leaking since
commit 3bc158f8d0330f0a ("netfilter: nf_tables: map basechain priority to
hardware priority") when nft_chain_offload_priority() returned an error.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 3bc158f8d0330f0a ("netfilter: nf_tables: map basechain priority to hardware priority")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
net/netfilter/nf_tables_api.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index e062754dc6cc..63c70141b3e5 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2243,6 +2243,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 genmask,
if (err < 0) {
nft_chain_release_hook(&hook);
kfree(basechain);
+ free_percpu(stats);
return err;
}
if (stats)
--
2.35.1
next prev parent reply other threads:[~2022-09-21 7:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 7:38 [PATCH net 0/5] netfilter: bugfixes for net Florian Westphal
2022-09-21 7:38 ` [PATCH net 1/5] netfilter: conntrack: remove nf_conntrack_helper documentation Florian Westphal
2022-09-21 8:20 ` patchwork-bot+netdevbpf
2022-09-21 7:38 ` [PATCH net 2/5] netfilter: nf_tables: fix nft_counters_enabled underflow at nf_tables_addchain() Florian Westphal
2022-09-21 7:38 ` Florian Westphal [this message]
2022-09-21 7:38 ` [PATCH net 4/5] netfilter: ebtables: fix memory leak when blob is malformed Florian Westphal
2022-09-21 7:38 ` [PATCH net 5/5] netfilter: nf_ct_ftp: fix deadlock when nat rewrite is needed Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220921073825.4658-4-fw@strlen.de \
--to=fw@strlen.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).