Skip to contentSkip to conversation

mac80211: fix nested sdata lock for IBSS/CSA

PATCH Applied Simon Wunderlich 2 participants 2 messages Dec 5, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix nested sdata lock for IBSS/CSA

This fixes a regression introduced by my patch "mac80211: don't cancel csa finalize work within stop_ap", which added sdata locks to ieee80211_csa_finalize_work() without removing the locking for ieee80211_ibss_finish_csa(), which is called by the former, resulting in a deadlock due to nested locking.

---
 net/mac80211/ibss.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/mac80211/ibss.c +1 -2
index 0f1fb5d..d09f662 100644
@@ -534,7 +534,7 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
 	int err;
 	u16 capability;
 
-	sdata_lock(sdata);
+	sdata_assert_lock(sdata);
 	/* update cfg80211 bss information with the new channel */
 	if (!is_zero_ether_addr(ifibss->bssid)) {
 		capability = WLAN_CAPABILITY_IBSS;
@@ -559,7 +559,6 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
 
 	/* generate the beacon */
 	err = ieee80211_ibss_csa_beacon(sdata, NULL);
-	sdata_unlock(sdata);
 	if (err < 0)
 		return err;
 
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw
Quoted 5 lines · Simon Wunderlich

This fixes a regression introduced by my patch "mac80211: don't cancel csa finalize work within stop_ap", which added sdata locks to ieee80211_csa_finalize_work() without removing the locking for ieee80211_ibss_finish_csa(), which is called by the former, resulting in a deadlock due to nested locking.

Applied.

Maybe you can make a hwsim test for this too :)

johannes