From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH 2/3] netlink: Avoid storage leak in tunnel_parse_opt_cb error path
Date: Wed, 11 Nov 2026 18:01:46 +0100 [thread overview]
Message-ID: <20261111170147.47501-3-phil@nwl.cc> (raw)
In-Reply-To: <20261111170147.47501-1-phil@nwl.cc>
When aborting geneve opt parsing, free the allocated object.
Fixes: 59f03bf14835f ("tunnel: add geneve support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
src/netlink.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/netlink.c b/src/netlink.c
index 8916370604c08..452721ec0be96 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -1960,8 +1960,10 @@ static int tunnel_parse_opt_cb(struct nftnl_tunnel_opt *opt, void *data) {
if (nftnl_tunnel_opt_get_flags(opt) & (1 << NFTNL_TUNNEL_GENEVE_DATA)) {
gnv_data = nftnl_tunnel_opt_get_data(opt, NFTNL_TUNNEL_GENEVE_DATA,
&geneve->data_len);
- if (!gnv_data)
+ if (!gnv_data) {
+ free(geneve);
return -1;
+ }
memcpy(&geneve->data, gnv_data, geneve->data_len);
}
--
2.54.0
next prev parent reply other threads:[~2026-11-11 17:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 17:01 [nft PATCH 0/3] Fix two leaks in error path, one extra Phil Sutter
2026-11-11 17:01 ` [nft PATCH 1/3] parser_json: Avoid storage leak in json_parse_set_expr error path Phil Sutter
2026-11-11 17:01 ` Phil Sutter [this message]
2026-11-11 17:01 ` [nft PATCH 3/3] bison: Drop pointless NULL-check Phil Sutter
2026-11-11 20:04 ` [nft PATCH 0/3] Fix two leaks in error path, one extra Florian Westphal
2026-11-11 22:57 ` Phil Sutter
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=20261111170147.47501-3-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.