Thread (2 messages) 2 messages, 2 authors, 2021-12-20
STALE1644d LANDED

[PATCH] mac80211: fix locking in ieee80211_start_ap error path

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2021-12-20 08:09:28
Also in: stable
Subsystem: mac80211, the rest · Maintainers: Johannes Berg, Linus Torvalds

From: Johannes Berg <redacted>

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 <redacted>
---
#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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help