From: Jason Xing <kerneljasonxing@gmail.com>
To: Stanislav Fomichev <stfomichev@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
syzbot <syzbot+e67ea9c235b13b4f0020@syzkaller.appspotmail.com>,
andrii@kernel.org, ast@kernel.org, bjorn@kernel.org,
bpf@vger.kernel.org, daniel@iogearbox.net, davem@davemloft.net,
edumazet@google.com, horms@kernel.org, jonathan.lemon@gmail.com,
linux-kernel@vger.kernel.org, maciej.fijalkowski@intel.com,
magnus.karlsson@intel.com, netdev@vger.kernel.org,
pabeni@redhat.com, sdf@fomichev.me,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bpf?] [net?] possible deadlock in xsk_notifier (3)
Date: Thu, 26 Jun 2025 08:24:16 +0800 [thread overview]
Message-ID: <CAL+tcoDkgcBfFsHRzjNCm-VYq8-bV+VjPm259+qu548GurZggA@mail.gmail.com> (raw)
In-Reply-To: <aFyIRxuBrpRsB0iF@mini-arch>
On Thu, Jun 26, 2025 at 7:37 AM Stanislav Fomichev <stfomichev@gmail.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
prev parent reply other threads:[~2025-06-26 0:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 18:51 [syzbot] [bpf?] [net?] possible deadlock in xsk_notifier (3) syzbot
2025-06-25 13:44 ` Jason Xing
2025-06-25 15:06 ` Stanislav Fomichev
2025-06-25 15:38 ` Jason Xing
2025-06-25 15:46 ` Stanislav Fomichev
2025-06-25 20:48 ` Stanislav Fomichev
2025-06-25 21:03 ` Jakub Kicinski
2025-06-25 23:37 ` Stanislav Fomichev
2025-06-26 0:24 ` Jason Xing [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAL+tcoDkgcBfFsHRzjNCm-VYq8-bV+VjPm259+qu548GurZggA@mail.gmail.com \
--to=kerneljasonxing@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jonathan.lemon@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=stfomichev@gmail.com \
--cc=syzbot+e67ea9c235b13b4f0020@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).