All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH RFC nft] src: avoid re-initing core library when a second context struct is allocated
Date: Thu, 8 Aug 2019 00:41:26 +0200	[thread overview]
Message-ID: <20190807224125.ysj5qyw3xxgdouc4@salvia> (raw)
In-Reply-To: <20190805214917.13747-1-fw@strlen.de>

On Mon, Aug 05, 2019 at 11:49:17PM +0200, Florian Westphal wrote:
> Calling nft_ctx_new() a second time leaks memory, and calling
> nft_ctx_free a second time -- on a different context -- causes
> double-free.
> 
> This patch won't work in case we assume libnftables should be
> thread-safe, in such case we either need a mutex or move all resources
> under nft_ctx scope.

These two should avoid the memleak / double free I think:

https://patchwork.ozlabs.org/patch/1143742/
https://patchwork.ozlabs.org/patch/1143743/

Not thread-safe yet, there is a bunch global variables still in place.

  reply	other threads:[~2019-08-07 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 21:49 [PATCH RFC nft] src: avoid re-initing core library when a second context struct is allocated Florian Westphal
2019-08-07 22:41 ` Pablo Neira Ayuso [this message]
2019-08-07 23:37   ` 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=20190807224125.ysj5qyw3xxgdouc4@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --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 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.