From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbdECWDP (ORCPT ); Wed, 3 May 2017 18:03:15 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35904 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751198AbdECWDI (ORCPT ); Wed, 3 May 2017 18:03:08 -0400 MIME-Version: 1.0 In-Reply-To: <4ef76406-8e05-ccdf-fefb-dc47d56c71c9@gmail.com> References: <4ef76406-8e05-ccdf-fefb-dc47d56c71c9@gmail.com> From: Cong Wang Date: Wed, 3 May 2017 15:02:46 -0700 Message-ID: Subject: Re: net/ipv6: GPF in rt6_device_match To: David Ahern Cc: Andrey Konovalov , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , Dmitry Vyukov , Kostya Serebryany , Eric Dumazet , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 3, 2017 at 11:22 AM, David Ahern wrote: > On 5/3/17 11:02 AM, Cong Wang wrote: >> A quick glance shows we need to simply check local->rt6i_idev >> since we do the same check for sprt right above. > > As I recall, rt6i_idev is set for all routes except null_entry and it is > not set on null_entry only because of initialization order. Are you sure? if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) { net->ipv6.ip6_null_entry->dst.dev = dev; net->ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(dev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif } Loopback is the first one to register, so null entry is set to loopback dev initially. Similar for init_net.