[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190320.110751.2209159066346004024.davem@davemloft.net>
Date: Wed, 20 Mar 2019 11:07:51 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: lucien.xin@...il.com
Cc: netdev@...r.kernel.org, weiwan@...gle.com, dsahern@...il.com,
pabeni@...hat.com
Subject: Re: [PATCHv2 net] ipv6: make ip6_create_rt_rcu return
ip6_null_entry instead of NULL
From: Xin Long <lucien.xin@...il.com>
Date: Wed, 20 Mar 2019 14:45:48 +0800
> Jianlin reported a crash:
>
> [ 381.484332] BUG: unable to handle kernel NULL pointer dereference at 0000000000000068
> [ 381.619802] RIP: 0010:fib6_rule_lookup+0xa3/0x160
> [ 382.009615] Call Trace:
> [ 382.020762] <IRQ>
> [ 382.030174] ip6_route_redirect.isra.52+0xc9/0xf0
> [ 382.050984] ip6_redirect+0xb6/0xf0
> [ 382.066731] icmpv6_notify+0xca/0x190
> [ 382.083185] ndisc_redirect_rcv+0x10f/0x160
> [ 382.102569] ndisc_rcv+0xfb/0x100
> [ 382.117725] icmpv6_rcv+0x3f2/0x520
> [ 382.133637] ip6_input_finish+0xbf/0x460
> [ 382.151634] ip6_input+0x3b/0xb0
> [ 382.166097] ipv6_rcv+0x378/0x4e0
>
> It was caused by the lookup function __ip6_route_redirect() returns NULL in
> fib6_rule_lookup() when ip6_create_rt_rcu() returns NULL.
>
> So we fix it by simply making ip6_create_rt_rcu() return ip6_null_entry
> instead of NULL.
>
> v1->v2:
> - move down 'fallback:' to make it more readable.
>
> Fixes: e873e4b9cc7e ("ipv6: use fib6_info_hold_safe() when necessary")
> Reported-by: Jianlin Shi <jishi@...hat.com>
> Suggested-by: Paolo Abeni <pabeni@...hat.com>
> Signed-off-by: Xin Long <lucien.xin@...il.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists