* [PATCH] Fix breakage on WEP for cards that rely on software decoding
@ 2007-08-28 22:45 Adam Baker
2007-08-29 8:39 ` Johannes Berg
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Adam Baker @ 2007-08-28 22:45 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Ivo van Doorn, rt2400-devel
The test to drop out of ieee80211_rx_h_load_key if we don't know the IV should
check if the packet has already been decrypted, otherwise we need to load
the key to be able to decrypt it
Signed-off-by: Adam Baker <linux@baker-net.org.uk>
---
When using rt2x00 with WEP we get continuous reports of "RX WEP frame, but
no key set" without this patch. As the rt2x00 driver currently relies on
mac80211 to perform the decryption I believe it would be incorrect for the driver
to set IEEE80211_HW_WEP_INCLUDE_IV. Also reading some of the code
comments it appears that even for a card that does HW decryption there are
circumstances where the SW decryption will get used and in those cases
we need to set the key.
The patch was generated against the rt2x00 git but looks like it applies to
the current wireless-dev everything.
---
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 9c02dff..5bf7185 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -363,7 +363,8 @@ ieee80211_rx_h_load_key(struct ieee80211
* we somehow allow the driver to tell us which key
* the hardware used if this flag is set?
*/
- if (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV))
+ if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
+ (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)))
return TXRX_CONTINUE;
hdrlen = ieee80211_get_hdrlen(rx->fc);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-28 22:45 [PATCH] Fix breakage on WEP for cards that rely on software decoding Adam Baker
@ 2007-08-29 8:39 ` Johannes Berg
2007-08-29 11:31 ` Johannes Berg
2007-08-29 12:09 ` Johannes Berg
2 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2007-08-29 8:39 UTC (permalink / raw)
To: Adam Baker; +Cc: linux-wireless, Ivo van Doorn, rt2400-devel
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
On Tue, 2007-08-28 at 23:45 +0100, Adam Baker wrote:
> The test to drop out of ieee80211_rx_h_load_key if we don't know the IV should
> check if the packet has already been decrypted, otherwise we need to load
> the key to be able to decrypt it
> - if (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV))
> + if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
> + (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)))
> return TXRX_CONTINUE;
Huh, yes, this patch is correct, I just never noticed because my later
patch changes it again when introducing the per-frame INCLUDE_IV flag.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-28 22:45 [PATCH] Fix breakage on WEP for cards that rely on software decoding Adam Baker
2007-08-29 8:39 ` Johannes Berg
@ 2007-08-29 11:31 ` Johannes Berg
2007-08-29 12:09 ` Johannes Berg
2 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2007-08-29 11:31 UTC (permalink / raw)
To: Adam Baker; +Cc: linux-wireless, Ivo van Doorn, rt2400-devel
[-- Attachment #1: Type: text/plain, Size: 853 bytes --]
On Tue, 2007-08-28 at 23:45 +0100, Adam Baker wrote:
> When using rt2x00 with WEP we get continuous reports of "RX WEP frame, but
> no key set" without this patch. As the rt2x00 driver currently relies on
> mac80211 to perform the decryption I believe it would be incorrect for the driver
> to set IEEE80211_HW_WEP_INCLUDE_IV. Also reading some of the code
> comments it appears that even for a card that does HW decryption there are
> circumstances where the SW decryption will get used and in those cases
> we need to set the key.
>
> The patch was generated against the rt2x00 git but looks like it applies to
> the current wireless-dev everything.
This seems correct but it looks like we need to fix a few more instances
of similar checks, especially those involving
"KEY_FLAG_UPLOADED_TO_HARDWARE". I'll take a look.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-28 22:45 [PATCH] Fix breakage on WEP for cards that rely on software decoding Adam Baker
2007-08-29 8:39 ` Johannes Berg
2007-08-29 11:31 ` Johannes Berg
@ 2007-08-29 12:09 ` Johannes Berg
2007-08-29 21:23 ` [Rt2400-devel] " Adam Baker
2 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2007-08-29 12:09 UTC (permalink / raw)
To: Adam Baker; +Cc: linux-wireless, Ivo van Doorn, rt2400-devel
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
On Tue, 2007-08-28 at 23:45 +0100, Adam Baker wrote:
> The test to drop out of ieee80211_rx_h_load_key if we don't know the IV should
> check if the packet has already been decrypted, otherwise we need to load
> the key to be able to decrypt it
I think this patch ought to fix it as well:
http://johannes.sipsolutions.net/patches/kernel/all/2007-08-29-12:08/023-rework-hardware-crypto-flags.patch
but it should probably have a few more changes.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Rt2400-devel] [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-29 12:09 ` Johannes Berg
@ 2007-08-29 21:23 ` Adam Baker
2007-08-30 12:00 ` Johannes Berg
0 siblings, 1 reply; 7+ messages in thread
From: Adam Baker @ 2007-08-29 21:23 UTC (permalink / raw)
To: rt2400-devel; +Cc: Johannes Berg, Ivo van Doorn, linux-wireless
On Wednesday 29 August 2007 13:09, Johannes Berg wrote:
>
> I think this patch ought to fix it as well:
> http://johannes.sipsolutions.net/patches/kernel/all/2007-08-29-12:08/023-re
>work-hardware-crypto-flags.patch
>
> but it should probably have a few more changes.
>
I can confirm that with that patch WEP is working for me. Another user on the
rt2x00 forum is also reporting success with it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Rt2400-devel] [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-29 21:23 ` [Rt2400-devel] " Adam Baker
@ 2007-08-30 12:00 ` Johannes Berg
2007-08-30 12:24 ` Robin Cornelius
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2007-08-30 12:00 UTC (permalink / raw)
To: Adam Baker; +Cc: rt2400-devel, Ivo van Doorn, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 257 bytes --]
On Wed, 2007-08-29 at 22:23 +0100, Adam Baker wrote:
> I can confirm that with that patch WEP is working for me. Another user on the
> rt2x00 forum is also reporting success with it.
Good. I'll be posting this patch for inclusion soon.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Rt2400-devel] [PATCH] Fix breakage on WEP for cards that rely on software decoding
2007-08-30 12:00 ` Johannes Berg
@ 2007-08-30 12:24 ` Robin Cornelius
0 siblings, 0 replies; 7+ messages in thread
From: Robin Cornelius @ 2007-08-30 12:24 UTC (permalink / raw)
To: Johannes Berg; +Cc: Adam Baker, rt2400-devel, Ivo van Doorn, linux-wireless
On 8/30/07, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Wed, 2007-08-29 at 22:23 +0100, Adam Baker wrote:
>
> > I can confirm that with that patch WEP is working for me. Another user on the
> > rt2x00 forum is also reporting success with it.
>
> Good. I'll be posting this patch for inclusion soon.
>
Hi Johannes,
A bit behind the boat here but another successful test (rt2x00:-
rt61pci, rt73usb and rt2500usb) here as well. Clears the issue for me.
Robin Cornelius
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-30 12:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-28 22:45 [PATCH] Fix breakage on WEP for cards that rely on software decoding Adam Baker
2007-08-29 8:39 ` Johannes Berg
2007-08-29 11:31 ` Johannes Berg
2007-08-29 12:09 ` Johannes Berg
2007-08-29 21:23 ` [Rt2400-devel] " Adam Baker
2007-08-30 12:00 ` Johannes Berg
2007-08-30 12:24 ` Robin Cornelius
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).