Skip to contentSkip to conversation

softmac: Fix deadlock of wx_set_essid with assoc work

PATCH In review Michael Buesch 2 participants 3 messages Jul 31, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softmac: Fix deadlock of wx_set_essid with assoc work

The essid wireless extension does deadlock against the assoc mutex, as we don't unlock the assoc mutex.

--

David, please test if this fixes your deadlock.

net/ieee80211/softmac/ieee80211softmac_wx.c +4 -1
Index: bu3sch-wireless-dev/net/ieee80211/softmac/ieee80211softmac_wx.c
===================================================================
@@ -98,9 +98,12 @@ ieee80211softmac_wx_set_essid(struct net
 				cancel_delayed_work(&authptr->work);
 			sm->associnfo.bssvalid = 0;
 			sm->associnfo.bssfixed = 0;
-			flush_scheduled_work();
 			sm->associnfo.associating = 0;
 			sm->associnfo.associated = 0;
+			/* Unlock mutex, otherwise we deadlock with the assoc work handler. */
+			mutex_unlock(&sm->associnfo.mutex);
+			flush_scheduled_work();
+			mutex_lock(&sm->associnfo.mutex);
 		}
 	}
 
Signature · 1 line
Greetings Michael.
#1 lore raw
Quoted 8 lines · Michael Buesch

The essid wireless extension does deadlock against the assoc mutex, as we don't unlock the assoc mutex.

--

David, please test if this fixes your deadlock.

Seems to, although I'll have to leave it a few more hours before I'm sure. Thanks.

Signature · 1 line
dwmw2
#2 lore raw
Quoted 4 lines · On Tuesday 31 July 2007 17:01:00 David Woodhouse wrote:
Quoted 3 lines · Michael Buesch

The essid wireless extension does deadlock against the assoc mutex, as we don't unlock the assoc mutex.

Quoted 8 lines
Quoted 5 lines

--

David, please test if this fixes your deadlock.

Seems to, although I'll have to leave it a few more hours before I'm sure. Thanks.

Ok, this is a deadlock, anyway. Even if it's not "your" deadlock. :) So I'll build a correct patch for this (this was an incomplete hack) and submit it.

Signature · 1 line
Greetings Michael.