Commit 4bad3a20 authored by Alexander Wetzel's avatar Alexander Wetzel Committed by Kalle Valo

ath9k: add NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 support

The ath9k driver was so far only able to rekey PTK0 keys correctly due
to the best effort queue flush added with commit 62872a9b
("mac80211: Fix PTK rekey freezes and clear text leak").

Add the needed queue flush and set NL80211_EXT_FEATURE_CAN_REPLACE_PTK0
to tell mac80211 that the driver can now rekey PTK0 keys correctly and
no longer needs the best effort flush.

Effectively this prevents mac80211 to warn when rekeying a PTK0 key
only.
Signed-off-by: default avatarAlexander Wetzel <alexander@wetzel-home.de>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200804164152.175375-1-alexander@wetzel-home.de
parent 54f9ab7b
......@@ -1014,6 +1014,7 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
wiphy_ext_feature_set(hw->wiphy,
NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS);
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
}
int ath9k_init_device(u16 devid, struct ath_softc *sc,
......
......@@ -19,6 +19,9 @@
#include "ath9k.h"
#include "btcoex.h"
static void ath9k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
u8 ath9k_parse_mpdudensity(u8 mpdudensity)
{
/*
......@@ -1701,6 +1704,15 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
return -EOPNOTSUPP;
}
/* There may be MPDUs queued for the outgoing PTK key. Flush queues to
* make sure these are not send unencrypted or with a wrong (new) key
*/
if (cmd == DISABLE_KEY && key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
ieee80211_stop_queues(hw);
ath9k_flush(hw, vif, 0, true);
ieee80211_wake_queues(hw);
}
mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc);
ath_dbg(common, CONFIG, "Set HW Key %d\n", cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment