diff mbox series

[1/2] mac80211: Fix Extended Key ID auto activation

Message ID 20190422213412.16533-1-alexander@wetzel-home.de (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series [1/2] mac80211: Fix Extended Key ID auto activation | expand

Commit Message

Alexander Wetzel April 22, 2019, 9:34 p.m. UTC
Only enable Extended Key ID support for drivers which are not supporting
crypto offload and also do not support A-MPDU.

While any driver using SW crypto from mac80211 is generally able to also
support Extended Key ID these drivers are likely to mix keyIDs in
AMPDUs when rekeying.

According to IEEE 802.11-2016 "9.7.3 A-MPDU contents" this is not
allowed.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
---
 net/mac80211/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Johannes Berg April 23, 2019, 12:14 p.m. UTC | #1
On Mon, 2019-04-22 at 23:34 +0200, Alexander Wetzel wrote:
> Only enable Extended Key ID support for drivers which are not supporting
> crypto offload and also do not support A-MPDU.
> 
> While any driver using SW crypto from mac80211 is generally able to also
> support Extended Key ID these drivers are likely to mix keyIDs in
> AMPDUs when rekeying.
> 
> According to IEEE 802.11-2016 "9.7.3 A-MPDU contents" this is not
> allowed.
> 

I applied this (with some changes), but please resend the other patch as
two separate patches to mac80211/hwsim.

johannes
Alexander Wetzel April 23, 2019, 8:59 p.m. UTC | #2
Am 23.04.19 um 14:14 schrieb Johannes Berg:
> On Mon, 2019-04-22 at 23:34 +0200, Alexander Wetzel wrote:
>> Only enable Extended Key ID support for drivers which are not supporting
>> crypto offload and also do not support A-MPDU.
>>
>> While any driver using SW crypto from mac80211 is generally able to also
>> support Extended Key ID these drivers are likely to mix keyIDs in
>> AMPDUs when rekeying.
>>
>> According to IEEE 802.11-2016 "9.7.3 A-MPDU contents" this is not
>> allowed.
>>
> 
> I applied this (with some changes), but please resend the other patch as
> two separate patches to mac80211/hwsim.

I've just dropped you the updated patch for hwsim Extended Key ID 
support. That's kind of critical for the attempt to get Extended Key ID 
support merged in hostapd/wpa_supplicant.

The patch to allow ptk0 rekeys with hwsim should follow soon. (The PTK0 
rekey patches I have for hostapd/wpa_supplicant still need serious work 
anyhow and are far away to be ready for merge.)

Alexander
diff mbox series

Patch

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5d6b93050c0b..af73f42960fa 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1051,7 +1051,11 @@  int ieee80211_register_hw(struct ieee80211_hw *hw)
 		}
 	}
 
-	if (!local->ops->set_key ||
+	/* Enable Extended Key IDs when driver is either allowing it or only
+	 * supporting SW crypto without A-MPDU
+	 */
+	if (!(local->ops->set_key ||
+	      ieee80211_hw_check(hw, AMPDU_AGGREGATION)) ||
 	    ieee80211_hw_check(&local->hw, EXT_KEY_ID_NATIVE))
 		wiphy_ext_feature_set(local->hw.wiphy,
 				      NL80211_EXT_FEATURE_EXT_KEY_ID);