]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv6: don't call fib6_run_gc() until routing is ready
authorMichal KubeÄ\8dek <mkubecek@suse.cz>
Fri, 16 Dec 2016 10:13:51 +0000 (10:13 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:42 +0000 (11:03 +0100)
commitaf80b973dfd72d733212a1fe874c8252c7749632
tree8777d0608ada5273e759157d8910c9c5cc959fac
parent349759be02c3e69f6ea8b690450ae1b0b3b1b142
ipv6: don't call fib6_run_gc() until routing is ready

commit 2c861cc65ef4604011a0082e4dcdba2819aa191a upstream.

When loading the ipv6 module, ndisc_init() is called before
ip6_route_init(). As the former registers a handler calling
fib6_run_gc(), this opens a window to run the garbage collector
before necessary data structures are initialized. If a network
device is initialized in this window, adding MAC address to it
triggers a NETDEV_CHANGEADDR event, leading to a crash in
fib6_clean_all().

Take the event handler registration out of ndisc_init() into a
separate function ndisc_late_init() and move it after
ip6_route_init().

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: <stable@vger.kernel.org> # 3.10.y
Signed-off-by: Mike Manning <mmanning@brocade.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/net/ndisc.h
net/ipv6/af_inet6.c
net/ipv6/ndisc.c