Skip to content

Commit 8051bf2

Browse files
Kefeng Wanggregkh
authored andcommitted
ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock
[ Upstream commit 03e4deff4987f79c34112c5ba4eb195d4f9382b0 ] Just like commit 4acd494 ("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>
1 parent 8a066a8 commit 8051bf2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

net/ipv6/addrconf.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,8 +5244,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
52445244
struct net_device *dev;
52455245
struct inet6_dev *idev;
52465246

5247-
rcu_read_lock();
5248-
for_each_netdev_rcu(net, dev) {
5247+
for_each_netdev(net, dev) {
52495248
idev = __in6_dev_get(dev);
52505249
if (idev) {
52515250
int changed = (!idev->cnf.disable_ipv6) ^ (!newf);
@@ -5254,7 +5253,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
52545253
dev_disable_change(idev);
52555254
}
52565255
}
5257-
rcu_read_unlock();
52585256
}
52595257

52605258
static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)

0 commit comments

Comments
 (0)