All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: eric@regit.org, netfilter-devel@vger.kernel.org
Subject: Re: datatype: fix crash if wrong integer type is passed
Date: Fri, 10 Jan 2014 11:13:13 +0000	[thread overview]
Message-ID: <20140110111312.GA28513@macbook.localnet> (raw)
In-Reply-To: <20140110101504.GA4583@localhost>

On Fri, Jan 10, 2014 at 11:15:04AM +0100, Pablo Neira Ayuso wrote:
> On Fri, Jan 10, 2014 at 10:02:46AM +0000, Patrick McHardy wrote:
> > On Fri, Jan 10, 2014 at 10:52:47AM +0100, Pablo Neira Ayuso wrote:
> [...]
> > > So integer_type_parse() returns NULL, note that **res is left
> > > uninitialized.
> > 
> > Right, but only if invoked from an upper layer datatype. This needs to
> > make sure we don't return NULL without an erec. This was actually a bug
> > in the meta expression that I just posted a fix for.
> >
> > > Going back to expr_evaluate_symbol(), since NULL is returned, it
> > > assumes that an expression has been allocated.
> > > 
> > > I guess this doesn't crash all the time as we're relying on an
> > > uninitialized memory area and we can argue that the fix may not be
> > > optimal, but I really think this is fixing something.
> > 
> > Well, the proper fix seems to be to initialize *res to NULL in meta
> > before invoking the integer type parsing function.
> 
> I guess you mean this patch: http://patchwork.ozlabs.org/patch/309211/

Correct.

      reply	other threads:[~2014-01-10 11:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10  8:04 datatype: fix crash if wrong integer type is passed Patrick McHardy
2014-01-10  9:52 ` Pablo Neira Ayuso
2014-01-10 10:02   ` Patrick McHardy
2014-01-10 10:15     ` Pablo Neira Ayuso
2014-01-10 11:13       ` Patrick McHardy [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=20140110111312.GA28513@macbook.localnet \
    --to=kaber@trash.net \
    --cc=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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.