]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ipv6: initialize route null entry in addrconf_init()
authorWANG Cong <xiyou.wangcong@gmail.com>
Thu, 4 May 2017 05:07:31 +0000 (22:07 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:46:48 +0000 (10:46 +0200)
commit3f0bbd5f6f3bee6d1199fe387fa05df11ae04ef9
tree81080d1d8d6e0d6e333f9c07ebf2e6ff5fe7d086
parentcbae03be61711677cb5b729f1649bd258de7adfd
ipv6: initialize route null entry in addrconf_init()

BugLink: http://bugs.launchpad.net/bugs/1691369
[ Upstream commit 2f460933f58eee3393aba64f0f6d14acb08d1724 ]

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>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
include/net/ip6_route.h
net/ipv6/addrconf.c
net/ipv6/route.c