Re: [Patch net v3] ipv6: check for ip6_null_entry in __ip6_del_rt_siblings()
From: David Ahern <hidden>
Date: 2017-03-01 23:28:42
On 3/1/17 3:16 PM, Martin KaFai Lau wrote:
On Mon, Feb 27, 2017 at 04:14:04PM -0800, David Ahern wrote:quoted
On 2/27/17 4:07 PM, Cong Wang wrote:quoted
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 fromMissed 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?
ip6_null_entry
quoted
not that the null_entry is being returned as happens during a route lookup. This will also hit the bug: ip -6 ro del ::/0I 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.
yes, that was my point.