2020-05-12 10:04:31

by Chi-Hsien Lin

[permalink] [raw]
Subject: [PATCH] brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures

From: Chung-Hsien Hsu <[email protected]>

An incorrect value of use_fwsup is set for 4-way handshake offload for
WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
SAE authentication offload"). It results in missing bit
BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
failure. This patch correct the value for the case.

Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
brcmf_is_linkup() to fix SAE offload failure.

Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
offload")
Signed-off-by: Chung-Hsien Hsu <[email protected]>
Signed-off-by: Chi-Hsien Lin <[email protected]>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 4bd69d85fab9..bc6a1c48affa 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1819,6 +1819,10 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
switch (sme->crypto.akm_suites[0]) {
case WLAN_AKM_SUITE_SAE:
val = WPA3_AUTH_SAE_PSK;
+ if (sme->crypto.sae_pwd) {
+ brcmf_dbg(INFO, "using SAE offload\n");
+ profile->use_fwsup = BRCMF_PROFILE_FWSUP_SAE;
+ }
break;
default:
bphy_err(drvr, "invalid cipher group (%d)\n",
@@ -2104,11 +2108,6 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
goto done;
}

- if (sme->crypto.sae_pwd) {
- brcmf_dbg(INFO, "using SAE offload\n");
- profile->use_fwsup = BRCMF_PROFILE_FWSUP_SAE;
- }
-
if (sme->crypto.psk &&
profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
if (WARN_ON(profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE)) {
@@ -5505,7 +5504,8 @@ static bool brcmf_is_linkup(struct brcmf_cfg80211_vif *vif,
u32 event = e->event_code;
u32 status = e->status;

- if (vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_PSK &&
+ if ((vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_PSK ||
+ vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_SAE) &&
event == BRCMF_E_PSK_SUP &&
status == BRCMF_E_STATUS_FWSUP_COMPLETED)
set_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state);
--
2.1.0


2020-05-12 10:43:14

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures

Chi-Hsien Lin <[email protected]> writes:

> From: Chung-Hsien Hsu <[email protected]>
>
> An incorrect value of use_fwsup is set for 4-way handshake offload for
> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
> SAE authentication offload"). It results in missing bit
> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
> failure. This patch correct the value for the case.
>
> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
> brcmf_is_linkup() to fix SAE offload failure.
>
> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
> offload")

Fixes line needs to be in one line. I can fix that during commit, no
need to resend because of this.

--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2020-05-12 10:51:29

by Chi-Hsien Lin

[permalink] [raw]
Subject: Re: [PATCH] brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures



On 05/12/2020 6:42, Kalle Valo wrote:
> Chi-Hsien Lin <[email protected]> writes:
>
>> From: Chung-Hsien Hsu <[email protected]>
>>
>> An incorrect value of use_fwsup is set for 4-way handshake offload for
>> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
>> SAE authentication offload"). It results in missing bit
>> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
>> failure. This patch correct the value for the case.
>>
>> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
>> brcmf_is_linkup() to fix SAE offload failure.
>>
>> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
>> offload")
>
> Fixes line needs to be in one line. I can fix that during commit, no
> need to resend because of this.

Thanks a lot for fixing it. We'll use one line going forward.

>

2020-05-13 15:52:25

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures

Chi-Hsien Lin <[email protected]> wrote:

> From: Chung-Hsien Hsu <[email protected]>
>
> An incorrect value of use_fwsup is set for 4-way handshake offload for
> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
> SAE authentication offload"). It results in missing bit
> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
> failure. This patch correct the value for the case.
>
> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
> brcmf_is_linkup() to fix SAE offload failure.
>
> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication offload")
> Signed-off-by: Chung-Hsien Hsu <[email protected]>
> Signed-off-by: Chi-Hsien Lin <[email protected]>

Patch applied to wireless-drivers-next.git, thanks.

b2fe11f07773 brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures

--
https://patchwork.kernel.org/patch/11542809/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches