From patchwork Thu Feb 16 10:31:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 94047 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2439251qgi; Thu, 16 Feb 2017 02:33:10 -0800 (PST) X-Received: by 10.99.99.193 with SMTP id x184mr1909928pgb.226.1487241190403; Thu, 16 Feb 2017 02:33:10 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si6558016pln.325.2017.02.16.02.33.10; Thu, 16 Feb 2017 02:33:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754505AbdBPKdJ (ORCPT + 4 others); Thu, 16 Feb 2017 05:33:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:43107 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441AbdBPKdE (ORCPT ); Thu, 16 Feb 2017 05:33:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C08D5AD62; Thu, 16 Feb 2017 10:33:02 +0000 (UTC) From: Jiri Slaby To: stable@vger.kernel.org Cc: Kefeng Wang , "David S . Miller" , Jiri Slaby Subject: [patch added to 3.12-stable] ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock Date: Thu, 16 Feb 2017 11:31:56 +0100 Message-Id: <20170216103248.19251-20-jslaby@suse.cz> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170216103248.19251-1-jslaby@suse.cz> References: <20170216103248.19251-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kefeng Wang This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. -- 2.11.1 =============== [ Upstream commit 03e4deff4987f79c34112c5ba4eb195d4f9382b0 ] Just like commit 4acd4945cd1e ("ipv6: addrconf: Avoid calling netdevice notifiers with RCU read-side lock"), it is unnecessary to make addrconf_disable_change() use RCU iteration over the netdev list, since it already holds the RTNL lock, or we may meet Illegal context switch in RCU read-side critical section. Signed-off-by: Kefeng Wang Signed-off-by: David S. Miller Signed-off-by: Jiri Slaby --- net/ipv6/addrconf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1e31fc5477e8..74fe3375aa7a 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4693,8 +4693,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf) struct net_device *dev; struct inet6_dev *idev; - rcu_read_lock(); - for_each_netdev_rcu(net, dev) { + for_each_netdev(net, dev) { idev = __in6_dev_get(dev); if (idev) { int changed = (!idev->cnf.disable_ipv6) ^ (!newf); @@ -4703,7 +4702,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf) dev_disable_change(idev); } } - rcu_read_unlock(); } static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)