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.