netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH] xshared: fix memory leak in should_load_proto
Date: Tue, 30 May 2023 15:04:47 +0200	[thread overview]
Message-ID: <ZHX0b8i6sjuuyx5U@orbyte.nwl.cc> (raw)
In-Reply-To: <20230529171846.10616-1-ansuelsmth@gmail.com>

Hi Christian,

On Mon, May 29, 2023 at 07:18:46PM +0200, Christian Marangi wrote:
> With the help of a Coverity Scan, it was pointed out that it's present a
> memory leak in the corner case where find_proto is not NULL in the
> function should_load_proto. find_proto return a struct xtables_match
> pointer from xtables_find_match that is allocated but never freed.
> 
> Correctly free the found proto in the corner case where find_proto
> succeed.

We have a '--valgrind' mode in shell testsuite and this has not been
identified yet. So assuming your finding is correct, we lack a proper
test case. Can you provide a reproducer (ideally as shell test-case)?

Also I wonder if we can provide a Fixes: tag. The code in question is
very old, so maybe hard to find.

Thanks, Phil

  reply	other threads:[~2023-05-30 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 17:18 [iptables PATCH] xshared: fix memory leak in should_load_proto Christian Marangi
2023-05-30 13:04 ` Phil Sutter [this message]
2023-05-30 16:11 ` Jan Engelhardt
2023-06-16 16:22   ` 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=ZHX0b8i6sjuuyx5U@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=ansuelsmth@gmail.com \
    --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).