lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL+tcoDkgcBfFsHRzjNCm-VYq8-bV+VjPm259+qu548GurZggA@mail.gmail.com>
Date: Thu, 26 Jun 2025 08:24:16 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>, 
	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 Thu, Jun 26, 2025 at 7:37 AM Stanislav Fomichev <stfomichev@...il.com> wrote:
>
> 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.

Interesting case I find. Thank you both for the detailed explanation :)

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ