[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241114011708.3420819-1-lizhi.xu@windriver.com>
Date: Thu, 14 Nov 2024 09:17:08 +0800
From: Lizhi Xu <lizhi.xu@...driver.com>
To: <lizhi.xu@...driver.com>
CC: <alex.aring@...il.com>, <davem@...emloft.net>, <dmantipov@...dex.ru>,
<edumazet@...gle.com>, <horms@...nel.org>, <kuba@...nel.org>,
<linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>,
<linux-wpan@...r.kernel.org>, <miquel.raynal@...tlin.com>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>,
<stefan@...enfreihafen.org>,
<syzbot+985f827280dc3a6e7e92@...kaller.appspotmail.com>,
<syzkaller-bugs@...glegroups.com>
Subject: Re: [PATCH] mac802154: add a check for slave data list before delete
On Thu, 14 Nov 2024 09:00:25 +0800, Lizhi Xu wrote:
> On Wed, 13 Nov 2024 13:29:55 +0300, Dmitry Antipov wrote:
> > On 11/12/24 4:41 PM, Lizhi Xu wrote:
> >
> > > mutex_lock(&sdata->local->iflist_mtx);
> > > + if (list_empty(&sdata->local->interfaces)) {
> > > + mutex_unlock(&sdata->local->iflist_mtx);
> > > + return;
> > > + }
> > > list_del_rcu(&sdata->list);
> > > mutex_unlock(&sdata->local->iflist_mtx);
> >
> > Note https://syzkaller.appspot.com/text?tag=ReproC&x=12a9f740580000 makes an
> > attempt to connect the only device. How this is expected to work if there are
> > more than one device?
> There are two locks (rtnl and iflist_mtx) to protection and synchronization
> local->interfaces, so no need to worry about multiple devices.
In other words, this case is a race between removing the 802154 master
and the user sendmsg actively deleting the slave.
Then when the master is removed, there is no need to execute the latter to
remove the slave, because all the slave devices have been deleted when the
master device is removed..
Lizhi
Powered by blists - more mailing lists