From: Avraham Stern Date: Sat, 8 Mar 2025 21:19:25 +0000 (+0200) Subject: wifi: iwlwifi: mvm: fix setting the TK when associated X-Git-Tag: v6.15-rc1~160^2~20^2~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ad61970ac9e164be1b09b46c01aa942e8966132;p=thirdparty%2Fkernel%2Flinux.git wifi: iwlwifi: mvm: fix setting the TK when associated When running secured ranging and the initiator is associated with the responder, the TK was not set in the range request command. Fix it. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20250308231427.603dc31579d9.Icd19d797e56483c08dd22c55b96fee481c4d2f3d@changeid Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index dfb25b964f0eb..a493ef6bedc3e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -672,7 +672,11 @@ iwl_mvm_ftm_set_secured_ranging(struct iwl_mvm *mvm, struct ieee80211_vif *vif, target.bssid = bssid; target.cipher = cipher; + target.tk = NULL; ieee80211_iter_keys(mvm->hw, vif, iter, &target); + + if (!WARN_ON(!target.tk)) + memcpy(tk, target.tk, TK_11AZ_LEN); } else { memcpy(tk, entry->tk, sizeof(entry->tk)); }