diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2017-05-04 08:07:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 10:19:08 +0300 |
commit | 40aed603cc60af30c89eb7f72536c8ec5f33a8e5 (patch) | |
tree | 533b57bc2e51f6abd5a9c278a1d70242b7bc6996 /include/net | |
parent | d2422fe798d066fce82e79eda7192777e391efcb (diff) | |
download | linux-40aed603cc60af30c89eb7f72536c8ec5f33a8e5.tar.xz |
ipv6: initialize route null entry in addrconf_init()
[ 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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip6_route.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index eda131d179d9..2e765849ccd6 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -69,6 +69,7 @@ struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk, struct dst_entry *ip6_route_lookup(struct net *net, struct flowi6 *fl6, int flags); +void ip6_route_init_special_entries(void); int ip6_route_init(void); void ip6_route_cleanup(void); |