diff options
author | Daniel Drake <dsd@gentoo.org> | 2006-07-11 18:16:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-07-27 14:37:30 -0400 |
commit | 345f6b8beb20338a2d792bf5974d01d457abee53 (patch) | |
tree | 44169150155e8024f0b98cc709232490b4b35532 /net/ieee80211/softmac | |
parent | 8fa9ea18e831417159b7b1a76a944f117252f9ec (diff) |
[PATCH] softmac: do shared key auth in workqueue
Johann Uhrmann reported a bcm43xx crash and Michael Buesch tracked
it down to a problem with the new shared key auth code (recursive
calls into the driver)
This patch (effectively Michael's patch with a couple of small
modifications) solves the problem by sending the authentication
challenge response frame from a workqueue entry.
I also removed a lone \n from the bcm43xx messages relating to
authentication mode - this small change was previously discussed but
not patched in.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/softmac')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_auth.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c index ebc33ca6e692..4cef39e171d0 100644 --- a/net/ieee80211/softmac/ieee80211softmac_auth.c +++ b/net/ieee80211/softmac/ieee80211softmac_auth.c | |||
@@ -116,6 +116,16 @@ ieee80211softmac_auth_queue(void *data) | |||
116 | kfree(auth); | 116 | kfree(auth); |
117 | } | 117 | } |
118 | 118 | ||
119 | /* Sends a response to an auth challenge (for shared key auth). */ | ||
120 | static void | ||
121 | ieee80211softmac_auth_challenge_response(void *_aq) | ||
122 | { | ||
123 | struct ieee80211softmac_auth_queue_item *aq = _aq; | ||
124 | |||
125 | /* Send our response */ | ||
126 | ieee80211softmac_send_mgt_frame(aq->mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); | ||
127 | } | ||
128 | |||
119 | /* Handle the auth response from the AP | 129 | /* Handle the auth response from the AP |
120 | * This should be registered with ieee80211 as handle_auth | 130 | * This should be registered with ieee80211 as handle_auth |
121 | */ | 131 | */ |
@@ -197,24 +207,30 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
197 | case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: | 207 | case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: |
198 | /* Check to make sure we have a challenge IE */ | 208 | /* Check to make sure we have a challenge IE */ |
199 | data = (u8 *)auth->info_element; | 209 | data = (u8 *)auth->info_element; |
200 | if(*data++ != MFIE_TYPE_CHALLENGE){ | 210 | if (*data++ != MFIE_TYPE_CHALLENGE) { |
201 | printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); | 211 | printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); |
202 | break; | 212 | break; |
203 | } | 213 | } |
204 | /* Save the challenge */ | 214 | /* Save the challenge */ |
205 | spin_lock_irqsave(&mac->lock, flags); | 215 | spin_lock_irqsave(&mac->lock, flags); |
206 | net->challenge_len = *data++; | 216 | net->challenge_len = *data++; |
207 | if(net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) | 217 | if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) |
208 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; | 218 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; |
209 | if(net->challenge != NULL) | 219 | if (net->challenge != NULL) |
210 | kfree(net->challenge); | 220 | kfree(net->challenge); |
211 | net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); | 221 | net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); |
212 | memcpy(net->challenge, data, net->challenge_len); | 222 | memcpy(net->challenge, data, net->challenge_len); |
213 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; | 223 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; |
214 | spin_unlock_irqrestore(&mac->lock, flags); | ||
215 | 224 | ||
216 | /* Send our response */ | 225 | /* We reuse the work struct from the auth request here. |
217 | ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); | 226 | * It is safe to do so as each one is per-request, and |
227 | * at this point (dealing with authentication response) | ||
228 | * we have obviously already sent the initial auth | ||
229 | * request. */ | ||
230 | cancel_delayed_work(&aq->work); | ||
231 | INIT_WORK(&aq->work, &ieee80211softmac_auth_challenge_response, (void *)aq); | ||
232 | schedule_work(&aq->work); | ||
233 | spin_unlock_irqrestore(&mac->lock, flags); | ||
218 | return 0; | 234 | return 0; |
219 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: | 235 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: |
220 | kfree(net->challenge); | 236 | kfree(net->challenge); |