[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170301231648.2bpr7doxcipj5gi4@android-1601923ecb7aeff9.dhcp.thefacebook.com>
Date: Wed, 1 Mar 2017 15:16:48 -0800
From: Martin KaFai Lau <kafai@...com>
To: Cong Wang <xiyou.wangcong@...il.com>,
David Ahern <dsa@...ulusnetworks.com>
CC: <netdev@...r.kernel.org>, <andreyknvl@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [Patch net v3] ipv6: check for ip6_null_entry in
__ip6_del_rt_siblings()
On Mon, Feb 27, 2017 at 04:14:04PM -0800, David Ahern wrote:
> On 2/27/17 4:07 PM, Cong Wang wrote:
> > Andrey reported a NULL pointer deref bug in ipv6_route_ioctl()
> > -> ip6_route_del() -> __ip6_del_rt_siblings() code path. This is
> > because ip6_null_entry is returned in this path since ip6_null_entry
> > is kinda default for a ipv6 route table root node. Quote from
>
>
> Missed this earlier. The issue here is an attempt to delete the NULL
> route,
You meant rt == NULL or rt->rt6i_table == NULL when rt == ip6_null_entry?
> not that the null_entry is being returned as happens during a
> route lookup. This will also hit the bug:
> ip -6 ro del ::/0
I also found the commit log a bit confusing. By reading the message,
my first thought was an ip6_null_entry is returned because a route cannot
be found. Thanks for this particular test case. It seems fn is NULL
here for all random routes except 'ip -6 r del xyz::/0' which happens
to match ip6_null_entry.
[ An unrelated topic. I wonder ip -6 r del xyz::/0 would delete
the gateway route...]
The patch LGTM.
Powered by blists - more mailing lists