From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft] evaluate: memleak in binary operation transfer to RHS
Date: Thu, 17 Jun 2021 01:41:44 +0200 [thread overview]
Message-ID: <20210616234144.1277-1-pablo@netfilter.org> (raw)
Remove reference counter on expression that results in the memleak of
the RHS constant expression.
Direct leak of 136 byte(s) in 1 object(s) allocated from:
#0 0x7f4cd54af330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
#1 0x7f4cd4d9e489 in xmalloc /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:36
#2 0x7f4cd4d9e648 in xzalloc /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:75
#3 0x7f4cd4caf8c6 in expr_alloc /home/pablo/devel/scm/git-netfilter/nftables/src/expression.c:45
#4 0x7f4cd4cb36e9 in constant_expr_alloc /home/pablo/devel/scm/git-netfilter/nftables/src/expression.c:419
#5 0x7f4cd4ca714c in integer_type_parse /home/pablo/devel/scm/git-netfilter/nftables/src/datatype.c:397
#6 0x7f4cd4ca4bee in symbolic_constant_parse /home/pablo/devel/scm/git-netfilter/nftables/src/datatype.c:165
#7 0x7f4cd4ca4572 in symbol_parse /home/pablo/devel/scm/git-netfilter/nftables/src/datatype.c:135
#8 0x7f4cd4cc333f in expr_evaluate_symbol /home/pablo/devel/scm/git-netfilter/nftables/src/evaluate.c:251
[...]
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f4cd54af330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
#1 0x7f4cd4d9e489 in xmalloc /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:36
#2 0x7f4cd46185c5 in __gmpz_init2 (/usr/lib/x86_64-linux-gnu/libgmp.so.10+0x1c5c5)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/evaluate.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/evaluate.c b/src/evaluate.c
index 77fb24594735..35ef8a376170 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1770,8 +1770,6 @@ static int binop_transfer_one(struct eval_ctx *ctx,
return 0;
}
- expr_get(*right);
-
switch (left->op) {
case OP_LSHIFT:
(*right) = binop_expr_alloc(&(*right)->location, OP_RSHIFT,
--
2.20.1
reply other threads:[~2021-06-16 23:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210616234144.1277-1-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.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 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).