From 166b1a35fc03e847ca1976b7d89f6da99ccf93cb Mon Sep 17 00:00:00 2001 From: Sai Pavan Akhil Remella Date: Mon, 22 Nov 2021 12:58:37 +0530 Subject: [PATCH] qcacld-3.0: Fix invalid bssid filled while deleting pmksa In delete pmksa call for FILS case, the userspace sends only the ssid and cache id on the pmk cache. But the driver copies only the bssid which could cause invalid bssid being copied and the delete pmksa operation fails always. Fill pmksa ssid if SSID and cache id are provided, else copy the bssid. Change-Id: If18cfd86983c9fe9ae421295accf12bf1e8de148 CRs-Fixed: 3072262 --- core/hdd/src/wlan_hdd_cfg80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index fe625213ccef..1b9acfd88e35 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -22925,7 +22926,15 @@ static QDF_STATUS wlan_hdd_del_pmksa_cache(struct hdd_adapter *adapter, if (!vdev) return QDF_STATUS_E_FAILURE; - qdf_copy_macaddr(&pmksa.bssid, &pmk_cache->BSSID); + qdf_mem_zero(&pmksa, sizeof(pmksa)); + if (!pmk_cache->ssid_len) { + qdf_copy_macaddr(&pmksa.bssid, &pmk_cache->BSSID); + } else { + qdf_mem_copy(pmksa.ssid, pmk_cache->ssid, pmk_cache->ssid_len); + qdf_mem_copy(pmksa.cache_id, pmk_cache->cache_id, + WLAN_CACHE_ID_LEN); + pmksa.ssid_len = pmk_cache->ssid_len; + } result = wlan_crypto_set_del_pmksa(vdev, &pmksa, false); hdd_objmgr_put_vdev(vdev);