From: Greg Kroah-Hartman Date: Mon, 27 Nov 2017 11:57:44 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.85~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8cb5794e21df03fbea3d9a1cd849dab29ace6bcd;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: ipv6-only-call-ip6_route_dev_notify-once-for-netdev_unregister.patch --- diff --git a/queue-3.18/ipv6-only-call-ip6_route_dev_notify-once-for-netdev_unregister.patch b/queue-3.18/ipv6-only-call-ip6_route_dev_notify-once-for-netdev_unregister.patch new file mode 100644 index 00000000000..b47be44ee68 --- /dev/null +++ b/queue-3.18/ipv6-only-call-ip6_route_dev_notify-once-for-netdev_unregister.patch @@ -0,0 +1,48 @@ +From 76da0704507bbc51875013f6557877ab308cfd0a Mon Sep 17 00:00:00 2001 +From: WANG Cong +Date: Tue, 20 Jun 2017 11:42:27 -0700 +Subject: ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER + +From: WANG Cong + +commit 76da0704507bbc51875013f6557877ab308cfd0a upstream. + +In commit 242d3a49a2a1 ("ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf") +I assumed NETDEV_REGISTER and NETDEV_UNREGISTER are paired, +unfortunately, as reported by jeffy, netdev_wait_allrefs() +could rebroadcast NETDEV_UNREGISTER event until all refs are +gone. + +We have to add an additional check to avoid this corner case. +For netdev_wait_allrefs() dev->reg_state is NETREG_UNREGISTERED, +for dev_change_net_namespace(), dev->reg_state is +NETREG_REGISTERED. So check for dev->reg_state != NETREG_UNREGISTERED. + +Fixes: 242d3a49a2a1 ("ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf") +Reported-by: jeffy +Cc: David Ahern +Signed-off-by: Cong Wang +Acked-by: David Ahern +Signed-off-by: David S. Miller +Cc: Konstantin Khlebnikov +Signed-off-by: Greg Kroah-Hartman + +--- + net/ipv6/route.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -2827,7 +2827,11 @@ static int ip6_route_dev_notify(struct n + net->ipv6.ip6_blk_hole_entry->dst.dev = dev; + net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); + #endif +- } else if (event == NETDEV_UNREGISTER) { ++ } else if (event == NETDEV_UNREGISTER && ++ dev->reg_state != NETREG_UNREGISTERED) { ++ /* NETDEV_UNREGISTER could be fired for multiple times by ++ * netdev_wait_allrefs(). Make sure we only call this once. ++ */ + in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); diff --git a/queue-3.18/series b/queue-3.18/series index baf52f0f5a5..ea86e4d5b94 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1 +1,2 @@ s390-disassembler-increase-show_code-buffer-size.patch +ipv6-only-call-ip6_route_dev_notify-once-for-netdev_unregister.patch