[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpVbcOL3BD6SkVAOFLVCX5q_OpO0vfYnwG6XE4vdJkiw5Q@mail.gmail.com>
Date: Wed, 3 May 2017 16:35:54 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: David Ahern <dsahern@...il.com>
Cc: Andrey Konovalov <andreyknvl@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>,
netdev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Kostya Serebryany <kcc@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
syzkaller <syzkaller@...glegroups.com>
Subject: Re: net/ipv6: GPF in rt6_device_match
On Wed, May 3, 2017 at 3:09 PM, David Ahern <dsahern@...il.com> wrote:
> On 5/3/17 4:02 PM, Cong Wang wrote:
>> On Wed, May 3, 2017 at 11:22 AM, David Ahern <dsahern@...il.com> 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.
>>
>
> Why don't you add a printk and see ;-)
Ah, we need:
@@ -4024,7 +4027,7 @@ static struct pernet_operations ip6_route_net_late_ops = {
static struct notifier_block ip6_route_dev_notifier = {
.notifier_call = ip6_route_dev_notify,
- .priority = 0,
+ .priority = -10, /* Must be called after addrconf_notify!! */
};
Powered by blists - more mailing lists