[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iLhfSGG_JOcpw8ovs6xzaaD8=xGpCFkjuAJ4rT1maZdXg@mail.gmail.com>
Date: Thu, 4 Dec 2025 06:47:07 -0800
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Dmitry Skorodumov <skorodumov.dmitry@...wei.com>, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, Kuniyuki Iwashima <kuniyu@...gle.com>, Xiao Liang <shaw.leon@...il.com>,
Stanislav Fomichev <sdf@...ichev.me>, Etienne Champetier <champetier.etienne@...il.com>,
"David S. Miller" <davem@...emloft.net>, linux-kernel@...r.kernel.org,
Andrew Lunn <andrew+netdev@...n.ch>
Subject: Re: [PATCH net 2/2] ipvlan: Take addr_lock in ipvlan_open()
On Thu, Dec 4, 2025 at 6:43 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On 12/2/25 3:11 PM, Dmitry Skorodumov wrote:
> > diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
> > index c390f4241621..53d311af2f44 100644
> > --- a/drivers/net/ipvlan/ipvlan_main.c
> > +++ b/drivers/net/ipvlan/ipvlan_main.c
> > @@ -182,18 +182,18 @@ 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;
> >
> > - rcu_read_lock();
> > + spin_lock_bh(&port->addrs_lock);
> > list_for_each_entry_rcu(addr, &ipvlan->addrs, anode)
>
> I'm surprised lockdep/rcu debug does not complain above. In any case I
> think you should replace list_for_each_entry_rcu() with
> list_for_each_entry(), here and below.
This would require CONFIG_PROVE_RCU_LIST=y
and some ipvlan selftests :)
> Thanks,
>
> Paolo
>
Powered by blists - more mailing lists