From 9b3dfb15cc4bd19b2c358cd5b3a7c0543feb345f Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Tue, 20 Oct 2020 05:13:50 +0530 Subject: [PATCH] qcacld-3.0: Fix to avoid sending invalid PMKID in FT-SuiteB roam In FT-SuiteB when STA connects to AP1 then PMK1 gets cached. And then STA disconnects from AP1 and connects to AP2 then PMK2 gets cached. Now if STA roams to AP1 then FW uses PMK2 from mlme session to create the PMKID. But the corresponding RSO command from driver sends the PMK1 to FW and the same gets updated in mlme session of FW. This results in failure of next roams, as the invalid PMKID gets created using PMK1. This fix helps in deleting the old/stale PMK cache entries that are under the same mobility domain as of the newly added entry in case of all the FT connections except FT-SAE. Change-Id: Id960e955f8669e19e950c1edc38a9f0a715292b7 CRs-Fixed: 2798713 --- core/sme/src/csr/csr_api_roam.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 09ee3d989540..520327f0857b 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -14112,6 +14112,7 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint32_t sessionId, bool update_to_fw) { struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId); + enum csr_akm_type akm_type; if (!pSession) { sme_err("session %d not found", sessionId); @@ -14126,6 +14127,16 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint32_t sessionId, return QDF_STATUS_SUCCESS; } + akm_type = pSession->connectedProfile.AuthType; + if ((akm_type == eCSR_AUTH_TYPE_FT_RSN || + akm_type == eCSR_AUTH_TYPE_FT_FILS_SHA256 || + akm_type == eCSR_AUTH_TYPE_FT_FILS_SHA384 || + akm_type == eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384) && + pSession->connectedProfile.mdid.mdie_present) { + sme_debug("Auth type: %d update the MDID in cache", akm_type); + csr_update_pmk_cache_ft(mac, sessionId, pSession); + } + if (update_to_fw) csr_roam_update_cfg(mac, sessionId, REASON_ROAM_PSK_PMK_CHANGED);