Skip to contentSkip to conversation

mac80211: fix sw crypto

PATCH In review Johannes Berg 4 participants 5 messages Jan 25, 2010 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix sw crypto

What a stupid mistake. In

commit 813d76694043d00b59475baa1fbfaf54a2eb7fad
Author: Johannes Berg <[email protected]>
Date: Sun Jan 17 01:47:58 2010 +0100

mac80211: move control.hw_key assignment

I inserted code testing the wrong flags field, which means that the test is almost always true (it's really testing for the peer's WMM support) and thus the later parts of the stack assume hw crypto will be done even if that's not true.

Obviously, that broke software crypto. Maxim said so specifically, and Jochen probably uses some cipher that iwl3945 doesn't support in hardware, which might also explain that Maxim reports that even hw crypto is broken.

Fix this to test the right flags field.

---
 net/mac80211/tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/tx.c +1 -1
@@ -559,7 +559,7 @@ ieee80211_tx_h_select_key(struct ieee802
 		}
 
 		if (!skip_hw && tx->key &&
-		    tx->key->conf.flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
+		    tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
 			info->control.hw_key = &tx->key->conf;
 	}
 
#1 lore raw
Quoted 14 lines · Johannes Berg

What a stupid mistake. In

commit 813d76694043d00b59475baa1fbfaf54a2eb7fad
Author: Johannes Berg <[email protected]>
Date: Sun Jan 17 01:47:58 2010 +0100

mac80211: move control.hw_key assignment

I inserted code testing the wrong flags field, which means that the test is almost always true (it's really testing for the peer's WMM support) and thus the later parts of the stack assume hw crypto will be done even if that's not true.

Quoted 5 lines

Obviously, that broke software crypto. Maxim said so specifically, and Jochen probably uses some cipher that iwl3945 doesn't support in hardware, which might also explain that Maxim reports that even hw crypto is broken.

This patch works for me. Thanks.

What chipers does iwl3945 support?
I use CCMP, and I also know that software encryption is used by default.

Best regards,
Maxim Levitsky

Quoted 23 lines

Fix this to test the right flags field.

---
 net/mac80211/tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/tx.c +1 -1
@@ -559,7 +559,7 @@ ieee80211_tx_h_select_key(struct ieee802
 		}
 
 		if (!skip_hw && tx->key &&
-		    tx->key->conf.flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
+		    tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
 			info->control.hw_key = &tx->key->conf;
 	}
 
author maintainer
#2 lore raw
Quoted 6 lines · Maxim Levitsky
Quoted 5 lines

Obviously, that broke software crypto. Maxim said so specifically, and Jochen probably uses some cipher that iwl3945 doesn't support in hardware, which might also explain that Maxim reports that even hw crypto is broken.

This patch works for me. Thanks.

Thanks for testing.

Quoted 2 lines

What chipers does iwl3945 support?
I use CCMP, and I also know that software encryption is used by default.

I don't know off-hand, but I'm pretty sure it doesn't do TKIP, or at least the driver doesn't.

johannes

Tested-by on v1 1/1
#3 lore raw
In reply to Johannes Berg
Quoted 14 lines · On Monday 25 January 2010 11:36:16 Johannes Berg wrote:

What a stupid mistake. In

commit 813d76694043d00b59475baa1fbfaf54a2eb7fad
Author: Johannes Berg <[email protected]>
Date: Sun Jan 17 01:47:58 2010 +0100

mac80211: move control.hw_key assignment

I inserted code testing the wrong flags field, which means that the test is almost always true (it's really testing for the peer's WMM support) and thus the later parts of the stack assume hw crypto will be done even if that's not true.

Quoted 8 lines

Obviously, that broke software crypto. Maxim said so specifically, and Jochen probably uses some cipher that iwl3945 doesn't support in hardware, which might also explain that Maxim reports that even hw crypto is broken.

Fix this to test the right flags field.

#4 lore raw
Quoted 22 lines · Fabio Rossi
Quoted 20 lines · On Monday 25 January 2010 11:36:16 Johannes Berg wrote:

What a stupid mistake. In

commit 813d76694043d00b59475baa1fbfaf54a2eb7fad
Author: Johannes Berg <[email protected]>
Date: Sun Jan 17 01:47:58 2010 +0100

mac80211: move control.hw_key assignment

I inserted code testing the wrong flags field, which means that the test is almost always true (it's really testing for the peer's WMM support) and thus the later parts of the stack assume hw crypto will be done even if that's not true.

Obviously, that broke software crypto. Maxim said so specifically, and Jochen probably uses some cipher that iwl3945 doesn't support in hardware, which might also explain that Maxim reports that even hw crypto is broken.

Quoted 4 lines
Quoted 2 lines

Fix this to test the right flags field.

Thanks,
Jochen