From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: 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 19:25:01 +0200 [thread overview]
Message-ID: <1341941101.3265.5799.camel@edumazet-glaptop> (raw)
In-Reply-To: <20120710.094428.1167234955738653678.davem@davemloft.net>
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
next prev parent reply other threads:[~2012-07-10 17:25 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 [this message]
2012-07-10 18:14 ` Greg Rose
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=1341941101.3265.5799.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=erezsh@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox