Skip to contentSkip to conversation

mac80211: Fix possible race between sta_unblock and network softirq

PATCH New Helmut Schaa 1 participant 1 message Jan 17, 2012 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Fix possible race between sta_unblock and network softirq

All other code paths in sta_unblock synchronize with the network softirq by using local_bh_disable/enable. Do the same around ieee80211_sta_ps_deliver_wakeup.

---

 net/mac80211/sta_info.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
net/mac80211/sta_info.c +4 -2
index 24d321f..5b4ab21 100644
@@ -238,9 +238,11 @@ static void sta_unblock(struct work_struct *wk)
 	if (sta->dead)
 		return;
 
-	if (!test_sta_flag(sta, WLAN_STA_PS_STA))
+	if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
+		local_bh_disable();
 		ieee80211_sta_ps_deliver_wakeup(sta);
-	else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
+		local_bh_enable();
+	} else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
 		clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
 
 		local_bh_disable();
Signature · 1 line
1.7.7