diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2017-01-19 03:26:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-04 03:47:10 -0500 |
commit | 79453ab8816401626be91070387ec751f508219b (patch) | |
tree | 0ca33dd3fe4824b58453b6c22c72414a05ec5af6 /net/ipv6 | |
parent | e9db042dca20f7b6c1969fa21b121dde01057a74 (diff) |
ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock
[ 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 <wangkefeng.wang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 4bc5ba3ae452..95dfcba38ff6 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -5515,8 +5515,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf) | |||
5515 | struct net_device *dev; | 5515 | struct net_device *dev; |
5516 | struct inet6_dev *idev; | 5516 | struct inet6_dev *idev; |
5517 | 5517 | ||
5518 | rcu_read_lock(); | 5518 | for_each_netdev(net, dev) { |
5519 | for_each_netdev_rcu(net, dev) { | ||
5520 | idev = __in6_dev_get(dev); | 5519 | idev = __in6_dev_get(dev); |
5521 | if (idev) { | 5520 | if (idev) { |
5522 | int changed = (!idev->cnf.disable_ipv6) ^ (!newf); | 5521 | int changed = (!idev->cnf.disable_ipv6) ^ (!newf); |
@@ -5525,7 +5524,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf) | |||
5525 | dev_disable_change(idev); | 5524 | dev_disable_change(idev); |
5526 | } | 5525 | } |
5527 | } | 5526 | } |
5528 | rcu_read_unlock(); | ||
5529 | } | 5527 | } |
5530 | 5528 | ||
5531 | static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf) | 5529 | static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf) |