netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: fix addition/deletion of elements from commit/abort
Date: Tue, 24 Feb 2015 19:53:19 +0100	[thread overview]
Message-ID: <20150224185319.GA32638@salvia> (raw)
In-Reply-To: <20150224143932.GA3713@acer.localdomain>

On Tue, Feb 24, 2015 at 02:39:33PM +0000, Patrick McHardy wrote:
> On 24.02, Pablo Neira Ayuso wrote:
> > On Sat, Feb 21, 2015 at 10:39:18AM +0000, Patrick McHardy wrote:
> > > On 20.02, Pablo Neira Ayuso wrote:
> > > > We have several problems in this path:
> > > > 
> > > > 1) There is a use-after-free when removing individual elements from
> > > >    the commit path.
> > > > 
> > > > 2) We have to uninit() the data part of the element from the abort
> > > >    path to avoid a chain refcount leak.
> > > > 
> > > > 3) We have to check for set->flags to see if there's a mapping, instead
> > > >    of the element flags.
> > > > 
> > > > 4) We have to check for !(flags & NFT_SET_ELEM_INTERVAL_END) to skip
> > > >    elements that are part of the interval that have no data part, so
> > > >    they don't need to be uninit().
> > > 
> > > Just wondering, in the delete case, don't we need to set the flags in
> > > the sets' ->get() function for this to work?
> > 
> > They are already set from hash and rbtree, so we only need to add the
> > check for NFT_SET_ELEM_INTERVAL_END from the commit path in nf_tables_api.c
> > 
> > Unless you have any further concern, I'll pass up this soon.
> 
> Right, in the hash case it's 0 anyways and rbtree does set them.
> 
> Looks good to me.

Ok, I'll pass this to David, thanks.

      reply	other threads:[~2015-02-24 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 16:11 [PATCH nf] netfilter: nf_tables: fix addition/deletion of elements from commit/abort Pablo Neira Ayuso
2015-02-21 10:39 ` Patrick McHardy
2015-02-24 13:53   ` Pablo Neira Ayuso
2015-02-24 14:39     ` Patrick McHardy
2015-02-24 18:53       ` Pablo Neira Ayuso [this message]

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=20150224185319.GA32638@salvia \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --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).