Skip to content

Commit 03e4def

Browse files
Kefeng Wangdavem330
authored andcommitted
ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 59cfa78 commit 03e4def

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/ipv6/addrconf.c

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

5543-
rcu_read_lock();
5544-
for_each_netdev_rcu(net, dev) {
5543+
for_each_netdev(net, dev) {
55455544
idev = __in6_dev_get(dev);
55465545
if (idev) {
55475546
int changed = (!idev->cnf.disable_ipv6) ^ (!newf);
@@ -5550,7 +5549,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
55505549
dev_disable_change(idev);
55515550
}
55525551
}
5553-
rcu_read_unlock();
55545552
}
55555553

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

0 commit comments

Comments
 (0)