From: Christopher Griffin After a channel switch an AP vdev goes on sending its group addressed frames under the group key index it used before the switch, and the firmware does not take the next new group key for them. hostapd rotates the group key to the other index, the driver installs it, the firmware acknowledges it, and the frames still go out under the old index. A station that was associated across the rotation holds both keys and notices nothing. A station that joins after it is given the new key only and cannot decrypt a single group addressed frame, so no ARP request and no DHCP answer sent as a broadcast reaches it, until the next rotation gives the old index a new key: a day later with hostapd's default. Seen on IPQ8074 with WLAN.HK.2.9.0.1 and on IPQ6018 with WLAN.HK.2.5.0.1, on every BSS of the radio, with the vdev restart of ath11k_mac_update_vif_chan() as well as when the vdevs are stopped and started again. A monitor shows the group frames under the old key index with their packet numbers running on. The first group key command after the switch is the one that has no effect on the key the firmware transmits with. Setting an unchanged key again never moves that key, which is why setting the keys again when the first station joins (commit 97acb0259cc9 ("wifi: ath11k: fix group data packet drops during rekey")) does not cure a BSS in this state. But sent right after the switch, for the keys already in place, it costs nothing and the rotation's key that follows is taken. It does not restart the packet numbers of the keys either, so stations already associated are not disturbed. Set the group keys of an AP vdev again once it is up on the new channel. On IPQ6018 a station that joined after a switch and one rotation was deaf in each of three runs without the change and decrypted both BSSs of the radio with it; on IPQ8074 both BSSs decrypted after each of two switches and rotations with it. The change and this message were written with Claude, an AI coding assistant. Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-03982-QCAHKSWPL_SILICONZ-3 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 Signed-off-by: Christopher Griffin --- Found on Arista APs running OpenWrt (a C-360 with IPQ8074, a W-318 and a C-200 with IPQ6018), on test networks: elsewhere multicast-to-unicast hid it. Tested on those boards with Linux 6.18 and ath11k from backports 7.2 carrying the same change, on 2.4 GHz only; not yet on 5 GHz, on a QCN9074, or with a station associated across the switch. On ath-next the patch is compile-tested only. A question for Qualcomm: is it known that the first group key command after a vdev restart does not change the key index the firmware transmits group frames with, and is it fixed in a later build? --- drivers/net/wireless/ath/ath11k/mac.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 04acd526a3ab9..345a6d7607be2 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -7854,6 +7854,22 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, arvif->vdev_id, ret); continue; } + + /* After a channel switch the firmware goes on sending group + * addressed frames under the key index it used before, and + * the first group key command after the switch does not + * change that: stations that join after the next rekey could + * not decrypt them until the rekey after it. Set the group + * keys again as they are, so that the next new key is taken. + * This neither restarts their packet numbers nor changes the + * key in use. + */ + if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { + ret = ath11k_set_group_keys(arvif); + if (ret) + ath11k_warn(ab, "failed to set group keys of vdev %d after channel switch: %d\n", + arvif->vdev_id, ret); + } } /* Restart the internal monitor vdev on new channel */ --- base-commit: 18d0bedbb5f0538396cb7f763ed9cd1dd69c5b23 change-id: 20261129-b4-ath11k-csa-group-keys-9f6e37176565 Best regards, -- Christopher Griffin