[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFyIRxuBrpRsB0iF@mini-arch>
Date: Wed, 25 Jun 2025 16:37:43 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Jason Xing <kerneljasonxing@...il.com>,
syzbot <syzbot+e67ea9c235b13b4f0020@...kaller.appspotmail.com>,
andrii@...nel.org, ast@...nel.org, bjorn@...nel.org,
bpf@...r.kernel.org, daniel@...earbox.net, davem@...emloft.net,
edumazet@...gle.com, horms@...nel.org, jonathan.lemon@...il.com,
linux-kernel@...r.kernel.org, maciej.fijalkowski@...el.com,
magnus.karlsson@...el.com, netdev@...r.kernel.org,
pabeni@...hat.com, sdf@...ichev.me, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [bpf?] [net?] possible deadlock in xsk_notifier (3)
On 06/25, Jakub Kicinski wrote:
> On Wed, 25 Jun 2025 13:48:03 -0700 Stanislav Fomichev wrote:
> > > > I'm still learning the af_xdp. Sure, I'm interested in it, just a bit
> > > > worried if I'm capable of completing it. I will try then.
> > >
> > > SG, thanks! If you need more details lmk, but basically we need to reorder
> > > netdev_lock_ops() and mutex_lock(lock: &xs->mutex)+XSK_READY check.
> > > And similarly for cleanup (out_unlock/out_release) path.
> >
> > Jakub just told me that I'm wrong and it looks similar to commit
> > f0433eea4688 ("net: don't mix device locking in dev_close_many()
> > calls"). So this is not as easy as flipping the lock ordering :-(
>
> I don't think registering a netdev from NETDEV_UP even of another
> netdev is going to play way with instance locks and lockdep.
> This is likely a false positive but if syzbot keeps complaining
> we could:
>
> diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
> index 995a7207bdf8..f357a7ac70ac 100644
> --- a/drivers/net/wan/lapbether.c
> +++ b/drivers/net/wan/lapbether.c
> @@ -81,7 +81,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev)
>
> static __inline__ int dev_is_ethdev(struct net_device *dev)
> {
> - return dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5);
> + return dev->type == ARPHRD_ETHER && !netdev_need_ops_lock(dev);
> }
>
> IDK what the dummy hack is there for, it's been like that since
> git begun..
Agreed. The driver itlself looks interesting. IIUC, when loaded, it
unconditionally creates virtual netdev for any eth device in the init
ns. A bit surprised that syzbot enables it, none of my machines have it
enabled.
Powered by blists - more mailing lists