]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath10k: Fix connection after GTK rekeying
authorLoic Poulain <loic.poulain@oss.qualcomm.com>
Tue, 2 Sep 2025 14:32:25 +0000 (16:32 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 18 Sep 2025 23:43:48 +0000 (16:43 -0700)
It appears that not all hardware/firmware implementations support
group key deletion correctly, which can lead to connection hangs
and deauthentication following GTK rekeying (delete and install).

To avoid this issue, instead of attempting to delete the key using
the special WMI_CIPHER_NONE value, we now replace the key with an
invalid (random) value.

This behavior has been observed with WCN39xx chipsets.

Tested-on: WCN3990 hw1.0 WLAN.HL.3.3.7.c2-00931-QCAHLSWMTPLZ-1
Reported-by: Alexey Klimov <alexey.klimov@linaro.org>
Closes: https://lore.kernel.org/all/DAWJQ2NIKY28.1XOG35E4A682G@linaro.org
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Tested-by: Alexey Klimov <alexey.klimov@linaro.org> # QRB2210 RB1
Link: https://patch.msgid.link/20250902143225.837487-1-loic.poulain@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath10k/mac.c

index 24dd794e31ea2ccd2f8c0481cda395dacce80ed5..154ac7a709824ef6501cbaec4db235a54e869244 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/acpi.h>
 #include <linux/of.h>
 #include <linux/bitfield.h>
+#include <linux/random.h>
 
 #include "hif.h"
 #include "core.h"
@@ -290,8 +291,15 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
                key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
 
        if (cmd == DISABLE_KEY) {
-               arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE];
-               arg.key_data = NULL;
+               if (flags & WMI_KEY_GROUP) {
+                       /* Not all hardware handles group-key deletion operation
+                        * correctly. Replace the key with a junk value to invalidate it.
+                        */
+                       get_random_bytes(key->key, key->keylen);
+               } else {
+                       arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE];
+                       arg.key_data = NULL;
+               }
        }
 
        return ath10k_wmi_vdev_install_key(arvif->ar, &arg);