* [PATCH] mac80211: fix locking in ieee80211_start_ap error path
@ 2021-12-20 8:08 Johannes Berg
2021-12-20 8:36 ` [syzbot] WARNING in ieee80211_vif_release_channel (2) syzbot
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2021-12-20 8:08 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, stable, syzbot+11c342e5e30e9539cabd
From: Johannes Berg <johannes.berg@intel.com>
We need to hold the local->mtx to release the channel context,
as even encoded by the lockdep_assert_held() there. Fix it.
Cc: stable@vger.kernel.org
Fixes: 295b02c4be74 ("mac80211: Add FILS discovery support")
Reported-by: syzbot+11c342e5e30e9539cabd@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master
---
net/mac80211/cfg.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index bd3d3195097f..2d0dd69f9753 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1264,7 +1264,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
return 0;
error:
+ mutex_lock(&local->mtx);
ieee80211_vif_release_channel(sdata);
+ mutex_unlock(&local->mtx);
+
return err;
}
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [syzbot] WARNING in ieee80211_vif_release_channel (2)
2021-12-20 8:08 [PATCH] mac80211: fix locking in ieee80211_start_ap error path Johannes Berg
@ 2021-12-20 8:36 ` syzbot
0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2021-12-20 8:36 UTC (permalink / raw)
To: johannes.berg, johannes, linux-wireless, stable, syzkaller-bugs
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-and-tested-by: syzbot+11c342e5e30e9539cabd@syzkaller.appspotmail.com
Tested on:
commit: 60ec7fcf qlcnic: potential dereference null pointer of..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master
kernel config: https://syzkaller.appspot.com/x/.config?x=fa556098924b78f0
dashboard link: https://syzkaller.appspot.com/bug?extid=11c342e5e30e9539cabd
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=1412bd93b00000
Note: testing is done by a robot and is best-effort only.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-20 8:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 8:08 [PATCH] mac80211: fix locking in ieee80211_start_ap error path Johannes Berg
2021-12-20 8:36 ` [syzbot] WARNING in ieee80211_vif_release_channel (2) syzbot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.