* [PATCH] wifi: ath: clear the keymap bits of default key slots on delete
@ 2026-11-25 2:35 Rosen Penev
2026-11-29 15:05 ` Fil Dunsky
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-11-25 2:35 UTC (permalink / raw)
To: linux-wireless; +Cc: Jeff Johnson, Jouni Malinen, John W. Linville
In station mode a hardware group key is installed in the key cache slot
matching its key index (1-3). ath_key_delete() returns early for slots
below IEEE80211_WEP_NKID, so their keymap bits are never cleared and
stay set after the key is gone.
ath9k_cmn_rx_skb_postprocess() marks a protected frame without a
hardware key match as RX_FLAG_DECRYPTED when the keymap bit of the key
ID in its IV is set. After any earlier network with a hardware group
key, a later network whose group key is done in software (GCMP,
GCMP-256, CCMP-256) then has all group-addressed data frames handed to
mac80211 as already decrypted. They are dropped, so the station never
answers ARP requests or other broadcasts from the AP side while
unicast keeps working.
The early return dates from when ath_init() marked slots 0-3 as
permanently in use. That was removed, but the early return was kept, so
the bits of these slots now stay set once a key has used them. Before
mac80211 gained software GCMP, GCMP-256 and CCMP-256, a later group key
normally went back into the same hardware slot, which hid the problem.
Seen on an AR9550 (Archer C7 v2, OpenWrt 25.12.6, backports 6.18.55) as
a station: wpa2-gcmp works on a freshly loaded driver, fails with 100%
loss of AP-originated pings after one wpa2-ccmp association and
recovers only after a module reload. With this change the sequence
GCMP, CCMP, GCMP, CCMP/TKIP-group, CCMP-256, CCMP with GTK rekeys,
GCMP-256 with BIP-GMAC-256 passes.
The slots below IEEE80211_WEP_NKID are never handed out by
ath_reserve_key_cache_slot(), so clearing their bits cannot free them
for another key.
Fixes: be2864cfff2f ("ath9k: Fixed RX decryption status reporting")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/wireless/ath/key.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index 0ae436bd9b66..0df26af987b7 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -593,8 +593,6 @@ void ath_key_delete(struct ath_common *common, u8 hw_key_idx)
ath_hw_keysetmac(common, hw_key_idx, NULL);
else
ath_hw_keyreset(common, hw_key_idx);
- if (hw_key_idx < IEEE80211_WEP_NKID)
- return;
clear_bit(hw_key_idx, common->keymap);
clear_bit(hw_key_idx, common->ccmp_keymap);
--
2.56.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: ath: clear the keymap bits of default key slots on delete
2026-11-25 2:35 [PATCH] wifi: ath: clear the keymap bits of default key slots on delete Rosen Penev
@ 2026-11-29 15:05 ` Fil Dunsky
0 siblings, 0 replies; 2+ messages in thread
From: Fil Dunsky @ 2026-11-29 15:05 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-wireless
Hi Rosen,
I reproduced this on a Securifi Almond+ with an AR9580 (ath9k), running
OpenWrt with Linux 6.18.64 and wireless backports 7.2.
After the 2.4 GHz radio associated as a WPA2-PSK station using CCMP
and then switched to an SAE-protected 802.11s mesh, peering reached
ESTAB, but batman-adv could no longer see the peer on that interface.
With 2.4 GHz as the only mesh path, none of 10 pings reached the peer.
With your patch applied, I repeated the same STA-to-mesh transition
with hardware crypto enabled (nohwcrypt=0). The batman-adv neighbor
reappeared. With the wired uplink and the 5 GHz radio disabled, all
40 pings from the Almond+ to the Almond 3S and all 12 in the reverse
direction succeeded over 2.4 GHz.
Tested-by: Fil Dunsky <filipp.dunsky@gmail.com>
Thanks,
Fil
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-29 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 2:35 [PATCH] wifi: ath: clear the keymap bits of default key slots on delete Rosen Penev
2026-11-29 15:05 ` Fil Dunsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox