netfilter-devel.vger.kernel.org archive mirror
 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 libnetfilter_queue] src: make nfq_open_nfnl thread-safe
Date: Mon, 20 Jun 2016 14:58:43 +0200	[thread overview]
Message-ID: <20160620125843.GA16454@salvia> (raw)
In-Reply-To: <20160620125227.GC2250@breakpoint.cc>

On Mon, Jun 20, 2016 at 02:52:27PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Mon, Jun 20, 2016 at 02:42:59PM +0200, Pablo Neira Ayuso wrote:
> > > On Mon, Jun 20, 2016 at 01:19:52PM +0200, Florian Westphal wrote:
> > > > nfq_open_nfnl uses an intermediate static object, so when
> > > > it is invoked by distinct threads at the same time there is a small
> > > > chance that some threads end up with another threads nfq_handle pointer
> > > > stored in ->data.
> > > > 
> > > > Tested-by: Michal Tesar <mtesar@redhat.com>
> > > > Signed-off-by: Florian Westphal <fw@strlen.de>
> > > 
> > > Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > 
> > Wait wait...
> 
> Sorry, already pushed it after seeing the Ack...
> 
> > This is allocated in this stack?
> > 
> >  struct nfq_handle *nfq_open_nfnl(struct nfnl_handle *nfnlh)
> >  {
> > +       struct nfnl_callback pkt_cb = {
> > +               .call           = __nfq_rcv_pkt,
> > +               .attr_count     = NFQA_MAX,
> > +       };
> > 
> > Then accessed out of it?
> > 
> > I mean, this is passed by reference to the callback registration.
> 
> AFAICS nfnl_callback_register() memcpy's the thing into nfnl_handle,
> which is malloc'd in nfq_open_nfnl.

Right, sorry for the noise.

      reply	other threads:[~2016-06-20 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 11:19 [PATCH libnetfilter_queue] src: make nfq_open_nfnl thread-safe Florian Westphal
2016-06-20 12:42 ` Pablo Neira Ayuso
2016-06-20 12:44   ` Pablo Neira Ayuso
2016-06-20 12:52     ` Florian Westphal
2016-06-20 12:58       ` 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=20160620125843.GA16454@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 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).