Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Documentation/networking/device_drivers/wifi/mt7932-neo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ lookup.
Station security
----------------

The driver advertises PSK and SAE with CCMP only. Firmware performs SAE
The driver advertises PSK and SAE with CCMP as the pairwise cipher. PSK also
accepts a TKIP group key, described below. Firmware performs SAE
authentication and the four-way handshake and owns PTK, GTK and IGTK;
there is no host key-install interface or external-auth exchange.

Expand All @@ -122,8 +123,19 @@ NetworkManager with wpa_supplicant, pending the hardware qualification below.
The standard SAE PWE settings (unspecified, hunting-and-pecking,
hash-to-element and both) are accepted; firmware chooses the exchange without
a host PWE field. Exact PWE policy behavior on 2.4 and 5 GHz still needs
qualification. SAE-PK, SAE-EXT-KEY and additional ciphers are not
advertised.
qualification. SAE-PK and SAE-EXT-KEY are not advertised.

TKIP is registered so that WPA2-PSK can join a WPA/WPA2 mixed-mode access point,
which pairs a CCMP unicast key with a TKIP group key. Pairwise TKIP, WPA1, and a
TKIP group key with SAE or OWE are refused. Firmware owns the TKIP group key like
any other. MIC failure reporting and TKIP countermeasures are left to firmware and
have not been verified: firmware runs the four-way handshake, so the host has no
KCK and calling ``cfg80211_michael_mic_failure()`` would do nothing.

J700 hardware testing joined one mixed-mode router on 2.4 and 5 GHz, and stayed
connected to a hostapd access point through 14 group rekeys at 60 second intervals
with ARP and mDNS still received. DHCP renewal, IPv6 router advertisements and a
commercial access point's own rekey still need qualification.

J700 hardware testing with NetworkManager and wpa_supplicant on a PSK+SAE
transition network has confirmed, on 2.4 GHz channel 6 and 5 GHz channel 149:
Expand Down
33 changes: 31 additions & 2 deletions drivers/net/wireless/mediatek/mt7932/association-test.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <kunit/test.h>
#include <linux/hex.h>
Expand Down Expand Up @@ -173,6 +173,7 @@
MT_AUTH_NO_PASSWORD, MT_AUTH_WPA, MT_AUTH_PAIR_COUNT,
MT_AUTH_PAIR, MT_AUTH_GROUP, MT_AUTH_NO_AKM, MT_AUTH_PSK_FIRST,
MT_AUTH_SAE_FIRST, MT_AUTH_OTHER_FIRST, MT_AUTH_OTHER_AKM, MT_AUTH_PSK,
MT_AUTH_OWE,
};

static void mt_connect_auth_test(struct kunit *test)
Expand All @@ -186,6 +187,13 @@
{ "pure PSK", MT_AUTH_PSK, 0, WLAN_AKM_SUITE_PSK },
{ "PSK missing PMK", MT_AUTH_PSK, 1, -EOPNOTSUPP },
{ "PSK required MFP", MT_AUTH_PSK, 2, -EOPNOTSUPP },
{ "PSK TKIP group", MT_AUTH_PSK, 3, WLAN_AKM_SUITE_PSK },
{ "PSK TKIP pairwise", MT_AUTH_PSK, 4, -EOPNOTSUPP },
{ "PSK WEP group", MT_AUTH_PSK, 5, -EOPNOTSUPP },
{ "PSK TKIP group missing PMK", MT_AUTH_PSK, 6, -EOPNOTSUPP },
{ "PSK TKIP group WPA1", MT_AUTH_PSK, 7, -EOPNOTSUPP },
{ "OWE", MT_AUTH_OWE, WLAN_CIPHER_SUITE_CCMP, WLAN_AKM_SUITE_OWE },
{ "OWE TKIP group", MT_AUTH_OWE, WLAN_CIPHER_SUITE_TKIP, -EOPNOTSUPP },
{ "pure SAE", MT_AUTH_NONE, 0, WLAN_AKM_SUITE_SAE },
{ "optional MFP", MT_AUTH_MFP, NL80211_MFP_OPTIONAL, WLAN_AKM_SUITE_SAE },
{ "no MFP", MT_AUTH_MFP, NL80211_MFP_NO, -EOPNOTSUPP },
Expand All @@ -210,7 +218,7 @@
{ "no pairwise", MT_AUTH_PAIR_COUNT, 0, -EOPNOTSUPP },
{ "multiple pairwise", MT_AUTH_PAIR_COUNT, 2, -EOPNOTSUPP },
{ "TKIP pairwise", MT_AUTH_PAIR, WLAN_CIPHER_SUITE_TKIP, -EOPNOTSUPP },
{ "TKIP group", MT_AUTH_GROUP, WLAN_CIPHER_SUITE_TKIP, -EOPNOTSUPP },
{ "SAE TKIP group", MT_AUTH_GROUP, WLAN_CIPHER_SUITE_TKIP, -EOPNOTSUPP },
{ "no AKM", MT_AUTH_NO_AKM, 0, -EOPNOTSUPP },
{ "SAE EXT KEY", MT_AUTH_OTHER_AKM, SUITE(0x000fac, 24), -EOPNOTSUPP },
{ "PSK SHA256", MT_AUTH_OTHER_AKM, WLAN_AKM_SUITE_PSK_SHA256, -EOPNOTSUPP },
Expand All @@ -223,6 +231,8 @@
{ "PSK first mixed versions", MT_AUTH_PSK_FIRST, 4, WLAN_AKM_SUITE_PSK },
{ "PSK first VERSION_3 only", MT_AUTH_PSK_FIRST, 5, -EOPNOTSUPP },
{ "SAE first mixed versions", MT_AUTH_SAE_FIRST, 2, WLAN_AKM_SUITE_SAE },
{ "SAE first TKIP group", MT_AUTH_SAE_FIRST, 3, -EOPNOTSUPP },
{ "PSK first TKIP group", MT_AUTH_PSK_FIRST, 6, WLAN_AKM_SUITE_PSK },
{ "unsupported AKM before SAE", MT_AUTH_OTHER_FIRST, 0, -EOPNOTSUPP },
};
u8 password[64] = {}, pmk[32] = {};
Expand Down Expand Up @@ -284,11 +294,26 @@
case MT_AUTH_PSK:
p.crypto.wpa_versions = NL80211_WPA_VERSION_2;
p.crypto.akm_suites[0] = WLAN_AKM_SUITE_PSK;
p.crypto.psk = value == 1 ? NULL : pmk;
p.crypto.psk = value == 1 || value == 6 ? NULL : pmk;
p.crypto.sae_pwd = NULL;
p.crypto.sae_pwd_len = 0;
p.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
p.mfp = value == 2 ? NL80211_MFP_REQUIRED : NL80211_MFP_NO;
if (value == 3 || value == 4 || value == 6 || value == 7)
p.crypto.cipher_group = WLAN_CIPHER_SUITE_TKIP;
if (value == 4)
p.crypto.ciphers_pairwise[0] = WLAN_CIPHER_SUITE_TKIP;
if (value == 5)
p.crypto.cipher_group = WLAN_CIPHER_SUITE_WEP40;
if (value == 7)
p.crypto.wpa_versions = NL80211_WPA_VERSION_1;
break;
case MT_AUTH_OWE:
p.crypto.akm_suites[0] = WLAN_AKM_SUITE_OWE;
p.crypto.cipher_group = value;
p.crypto.sae_pwd = NULL;
p.crypto.sae_pwd_len = 0;
p.auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM;
break;
case MT_AUTH_PSK_FIRST:
p.crypto.wpa_versions = value == 5 ? NL80211_WPA_VERSION_3 :
Expand All @@ -302,6 +327,8 @@
p.auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM;
p.mfp = value == 2 ? NL80211_MFP_REQUIRED :
value == 3 ? NL80211_MFP_NO : NL80211_MFP_OPTIONAL;
if (value == 6)
p.crypto.cipher_group = WLAN_CIPHER_SUITE_TKIP;
break;
case MT_AUTH_SAE_FIRST:
p.crypto.n_akm_suites = 2;
Expand All @@ -311,6 +338,8 @@
p.crypto.sae_pwd = NULL;
if (value == 2)
p.crypto.wpa_versions |= NL80211_WPA_VERSION_2;
if (value == 3)
p.crypto.cipher_group = WLAN_CIPHER_SUITE_TKIP;
p.mfp = NL80211_MFP_OPTIONAL;
break;
case MT_AUTH_OTHER_FIRST:
Expand Down
10 changes: 9 additions & 1 deletion drivers/net/wireless/mediatek/mt7932/association.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static inline int
mt7932_connect_auth(const struct cfg80211_connect_params *p)
{
u32 versions = p->crypto.wpa_versions;
bool tkip_group = p->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP;

/* SAE offload clients use VERSION_3; older clients use VERSION_2.
* A transition request can carry both. The selected AKM still owns
Expand All @@ -28,10 +29,17 @@ mt7932_connect_auth(const struct cfg80211_connect_params *p)
(versions & ~(NL80211_WPA_VERSION_2 | NL80211_WPA_VERSION_3)) ||
p->crypto.n_ciphers_pairwise != 1 ||
p->crypto.ciphers_pairwise[0] != WLAN_CIPHER_SUITE_CCMP ||
p->crypto.cipher_group != WLAN_CIPHER_SUITE_CCMP ||
(p->crypto.cipher_group != WLAN_CIPHER_SUITE_CCMP && !tkip_group) ||
p->crypto.n_akm_suites < 1)
return -EOPNOTSUPP;

/* WPA/WPA2 mixed-mode APs pair a CCMP unicast key with a TKIP group
* key. The firmware owns the handshake and both keys. Only plain
* WPA2-PSK may do this; pairwise TKIP stays refused.
*/
if (tkip_group && p->crypto.akm_suites[0] != WLAN_AKM_SUITE_PSK)
return -EOPNOTSUPP;

switch (p->crypto.akm_suites[0]) {
case WLAN_AKM_SUITE_PSK:
if ((versions & NL80211_WPA_VERSION_2) && p->crypto.psk &&
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt7932/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static const struct cfg80211_ops mt_cfg_ops = {
int mt_register_regulatory_gate(struct mt7932 *m)
{
static const int rates[] = {10,20,55,110,60,90,120,180,240,360,480,540};
static const u32 ciphers[] = { WLAN_CIPHER_SUITE_CCMP };
static const u32 ciphers[] = { WLAN_CIPHER_SUITE_CCMP, WLAN_CIPHER_SUITE_TKIP };
static const u32 akms[] = {
WLAN_AKM_SUITE_PSK, WLAN_AKM_SUITE_SAE, WLAN_AKM_SUITE_OWE,
};
Expand Down
Loading