It was forgotten to lock addrs in ipvlan_open(). Seems that code was initially written in assumption that any address change occurs under rtnl_lock(). But it's not true for the ipv6 case. So, we have to take addr_lock in ipvlan_open(). Signed-off-by: Dmitry Skorodumov --- drivers/net/ipvlan/ipvlan_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index c1df97a88a40..27d289aadef1 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -262,20 +262,20 @@ static void ipvlan_uninit(struct net_device *dev) static int ipvlan_open(struct net_device *dev) { struct ipvl_dev *ipvlan = netdev_priv(dev); + struct ipvl_port *port = ipvlan->port; struct ipvl_addr *addr; - if (ipvlan->port->mode == IPVLAN_MODE_L3 || - ipvlan->port->mode == IPVLAN_MODE_L3S) + if (port->mode == IPVLAN_MODE_L3 || port->mode == IPVLAN_MODE_L3S) dev->flags |= IFF_NOARP; else dev->flags &= ~IFF_NOARP; /* for learnable, addresses will be obtained from tx-packets. */ - if (!ipvlan_is_macnat(ipvlan->port)) { - rcu_read_lock(); + if (!ipvlan_is_macnat(port)) { + spin_lock_bh(&port->addrs_lock); list_for_each_entry_rcu(addr, &ipvlan->addrs, anode) ipvlan_ht_addr_add(ipvlan, addr); - rcu_read_unlock(); + spin_unlock_bh(&port->addrs_lock); } return 0; -- 2.25.1