All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Rose <gregory.v.rose@intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, <ogerlitz@mellanox.com>,
	<netdev@vger.kernel.org>, <shlomop@mellanox.com>,
	<amirv@mellanox.com>, <erezsh@mellanox.com>
Subject: Re: net-next kernel NULL pointer dereference at fib_rules_tclass
Date: Tue, 10 Jul 2012 11:14:34 -0700	[thread overview]
Message-ID: <20120710111434.00003ba8@unknown> (raw)
In-Reply-To: <1341941101.3265.5799.camel@edumazet-glaptop>

On Tue, 10 Jul 2012 19:25:01 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> On Tue, 2012-07-10 at 09:44 -0700, David Miller wrote:
> > From: Or Gerlitz <ogerlitz@mellanox.com>
> > Date: Tue, 10 Jul 2012 10:16:55 +0300
> > 
> > > Starting system logger: BUG: unable to handle kernel NULL pointer
> > > dereference at 00000000000000ac IP: [<ffffffff81320393>]
> > > fib_rules_tclass+0xf/0x17
> > 
> > Ok, fib_rules_tclass() checks for res->r being NULL and only
> > dereferences it if it is not.
> > 
> > fib4_rule->tclassid has offset ~0x8c on x86-64, and this fault
> > address is 0x10 bytes off.
> > 
> > Does this patch fix the problem?
> > 
> > diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
> > index 539c672..000c467 100644
> > --- a/include/net/ip_fib.h
> > +++ b/include/net/ip_fib.h
> > @@ -230,6 +230,7 @@ static inline int fib_lookup(struct net *net,
> > struct flowi4 *flp, struct fib_result *res)
> >  {
> >  	if (!net->ipv4.fib_has_custom_rules) {
> > +		res->r = NULL;
> >  		if (net->ipv4.fib_local &&
> >  		    !fib_table_lookup(net->ipv4.fib_local, flp,
> > res, FIB_LOOKUP_NOREF))
> 
> It does here, thanks

Works for me too.

Thanks,

> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-07-10 18:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10  7:16 net-next kernel NULL pointer dereference at fib_rules_tclass Or Gerlitz
2012-07-10  8:42 ` Lin Ming
2012-07-10  9:00   ` David Miller
2012-07-10 16:44 ` David Miller
2012-07-10 17:25   ` Eric Dumazet
2012-07-10 18:14     ` Greg Rose [this message]
2012-07-11  1:05       ` David Miller
2012-07-11  7:42         ` Or Gerlitz
  -- strict thread matches above, loose matches on Subject: below --
2012-07-10  7:29 Or Gerlitz

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=20120710111434.00003ba8@unknown \
    --to=gregory.v.rose@intel.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=erezsh@mellanox.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=shlomop@mellanox.com \
    /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.