From: David Ahern <dsahern@gmail.com>
To: David Miller <davem@davemloft.net>,
andreyknvl@google.com, xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [Patch net] ipv6: initialize route null entry in addrconf_init()
Date: Thu, 4 May 2017 11:12:45 -0600 [thread overview]
Message-ID: <896e63a7-d0ad-a4db-21fc-9abdb02dd9df@gmail.com> (raw)
In-Reply-To: <20170504.125144.78973292337920988.davem@davemloft.net>
On 5/4/17 10:51 AM, David Miller wrote:
> From: Andrey Konovalov <andreyknvl@google.com>
> Date: Thu, 4 May 2017 14:28:37 +0200
>
>> On Thu, May 4, 2017 at 7:07 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>> Andrey reported a crash on init_net.ipv6.ip6_null_entry->rt6i_idev
>>> since it is always NULL.
>>>
>>> This is clearly wrong, we have code to initialize it to loopback_dev,
>>> unfortunately the order is still not correct.
>>>
>>> loopback_dev is registered very early during boot, we lose a chance
>>> to re-initialize it in notifier. addrconf_init() is called after
>>> ip6_route_init(), which means we have no chance to correct it.
>>>
>>> Fix it by moving this initialization explicitly after
>>> ipv6_add_dev(init_net.loopback_dev) in addrconf_init().
>>>
>>> Reported-by: Andrey Konovalov <andreyknvl@google.com>
>>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>>
>> Hi Cong,
>>
>> This fixes the bug triggered by my reproducer.
>>
>> Thanks!
>>
>> Tested-by: Andrey Konovalov <andreyknvl@google.com>
>
> Applied and queued up for -stable, thanks.
>
This is not the complete solution; it only fixes init_net. It still
blows up when you do:
unshare -n
./rt6_device_match
same exact stack trace
next prev parent reply other threads:[~2017-05-04 17:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 5:07 [Patch net] ipv6: initialize route null entry in addrconf_init() Cong Wang
2017-05-04 12:28 ` Andrey Konovalov
2017-05-04 16:51 ` David Miller
2017-05-04 17:12 ` David Ahern [this message]
2017-05-04 17:19 ` Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=896e63a7-d0ad-a4db-21fc-9abdb02dd9df@gmail.com \
--to=dsahern@gmail.com \
--cc=andreyknvl@google.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).