linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: sean.wang@mediatek.com, lorenzo.bianconi@redhat.com
Cc: Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
	Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
	Deren.Wu@mediatek.com, km.lin@mediatek.com,
	robin.chiu@mediatek.com, ch.yeh@mediatek.com,
	posh.sun@mediatek.com, Eric.Liang@mediatek.com,
	Stella.Chang@mediatek.com, jemele@google.com,
	yenlinlai@google.com, linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/2] mt76: connac: fix GTK rekey offload failure on WPA mixed mode
Date: Fri, 13 Aug 2021 12:22:20 +0200	[thread overview]
Message-ID: <8de0c710-0c61-2369-7730-b2f07a86e626@nbd.name> (raw)
In-Reply-To: <1627426757-14811-1-git-send-email-sean.wang@mediatek.com>

On 2021-07-28 00:59, sean.wang@mediatek.com wrote:
> From: Leon Yen <Leon.Yen@mediatek.com>
> 
> Update the proper firmware programming sequence to fix GTK rekey
> offload failure on WPA mixed mode.
> 
> In the mt76_connac_mcu_key_iter,
> gtk_tlv->proto should be only set up on pairwise key
> and gtk_tlk->group_cipher should be only set up on the group key.
> 
> Otherwise, those parameters required by firmware would be set
> incorrectly to cause GTK rekey offload failure on WPA mixed mode
> and then disconnection follows.
> 
> Fixes: b47e21e75c80 ("mt76: mt7615: add gtk rekey offload support")
> Co-developed-by: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> ---
>  .../net/wireless/mediatek/mt76/mt76_connac_mcu.c  | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> index a2555dc0f003..d71393b1c5e6 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> @@ -1957,19 +1957,22 @@ mt76_connac_mcu_key_iter(struct ieee80211_hw *hw,
>  	    key->cipher != WLAN_CIPHER_SUITE_TKIP)
>  		return;
>  
> -	if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
> -		gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_1);
> +	if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>  		cipher = BIT(3);
> -	} else {
> -		gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_2);
> +	else
>  		cipher = BIT(4);
> -	}
>  
>  	/* we are assuming here to have a single pairwise key */
>  	if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
> +		if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
> +			gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_1);
> +		else
> +			gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_2);
Why is gtk_tlv->proto set to WPA version values based on the cipher
suite? That doesn't make much sense to me, since TKIP is supported by
WPA2 as well. I will apply this patch anyway, since this check is there
already, but this does look suspicious to me and should probably be
revisited.

- Felix

      parent reply	other threads:[~2021-08-13 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 22:59 [PATCH 1/2] mt76: connac: fix GTK rekey offload failure on WPA mixed mode sean.wang
2021-07-27 22:59 ` [PATCH 2/2] mt76: connac: add support maximum regulatory Tx power sean.wang
2021-07-28  7:35   ` Lorenzo Bianconi
2021-08-13 10:22 ` Felix Fietkau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8de0c710-0c61-2369-7730-b2f07a86e626@nbd.name \
    --to=nbd@nbd.name \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=jemele@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=yenlinlai@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).