Netdev List
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
	cscnull@gmail.com
Subject: Re: [PATCH nf] netfilter: nf_tables: move dumper state alloation into ->start
Date: Mon, 23 Jul 2018 13:09:11 +0200	[thread overview]
Message-ID: <20180723110911.guinjwo5vglcyw2z@salvia> (raw)
In-Reply-To: <20180723104714.24008-1-fw@strlen.de>

On Mon, Jul 23, 2018 at 12:47:14PM +0200, Florian Westphal wrote:
> Shaochun Chen points out we leak dumper filter state allocations
> stored in dump_control->data in case there is an error before netlink sets
> cb_running (after which ->done will be called at some point).
> 
> In order to fix this, add .start functions and do the allocations
> there.
> 
> ->done is going to clean up, and in case error occurs before
> ->start invocation no cleanups need to be done anymore.

LGTM. Thanks Florian

BTW, probably we can add cb->nla with strict typing instead, so we
don't need to use cb->data. This cb->nla would be only valid from
.start().

Then, set cb->nla to NULL after .start() is called. Just to make sure
people don't make wrong assumptions and try to access this from the
classic dump path?

Just an idea.

  reply	other threads:[~2018-07-23 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 10:47 [PATCH nf] netfilter: nf_tables: move dumper state alloation into ->start Florian Westphal
2018-07-23 11:09 ` Pablo Neira Ayuso [this message]
2018-07-23 11:18   ` shaochun chen
2018-07-23 16:47 ` David Miller
2018-07-23 22:07 ` Pablo Neira Ayuso

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=20180723110911.guinjwo5vglcyw2z@salvia \
    --to=pablo@netfilter.org \
    --cc=cscnull@gmail.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.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