Ver Fonte

qcacld-3.0: Add support for SAE single pmk validity

Currently when SAE single pmk lifetime expires, the userspace
issues disconnect. To avoid this, on reaching a threshold value
of the total pmk lifetime, the firmware will clear the single
PMK and initiate a roam scan to perform full SAE and derive
new pmk.

Add changes to:
1. Send the remaining single pmk timeout value in seconds to
firmware.
this is calculated as the diffence in pmk timeout configured by
userspace and the time passed after set_pmksa was done (which is
system timestamp between the set_pmksa timestamp and timestamp at
which RSO command is filled).
2. Add internal roam trigger for SPMK timeout trigger.
3. Set the roam score delta value as 0 for SPMK timeout roam
trigger.

Change-Id: I62c2ddbbfeb2811a4342d41f2bdaa8d988568bcc
CRs-Fixed: 2869665
Pragaspathi Thilagaraj há 4 anos atrás
pai
commit
9d61fc3d0e

+ 4 - 3
components/mlme/dispatcher/inc/cfg_mlme_lfr.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. 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
@@ -2455,7 +2455,8 @@
  * ROAM_TRIGGER_REASON_STA_KICKOUT BIT 15
  * ROAM_TRIGGER_REASON_ESS_RSSI    BIT 16
  * ROAM_TRIGGER_REASON_WTC_BTM     BIT 17
- * ROAM_TRIGGER_REASON_MAX         BIT 18
+ * ROAM_TRIGGER_REASON_PMK_TIMEOUT BIT 18
+ * ROAM_TRIGGER_REASON_MAX         BIT 19
  *
  * Related: none
  *
@@ -2469,7 +2470,7 @@
 			"roam_triggers", \
 			0, \
 			0xFFFFFFFF, \
-			0x3FFFF, \
+			0x7FFFF, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Bitmap of roaming triggers")
 

+ 4 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -2533,10 +2533,14 @@ enum pkt_origin {
  * struct mlme_pmk_info - SAE Roaming using single pmk info
  * @pmk: pmk
  * @pmk_len: pmk length
+ * @spmk_timeout_period: Time to generate new SPMK in seconds.
+ * @spmk_timestamp: System timestamp at which the Single PMK entry was added.
  */
 struct mlme_pmk_info {
 	uint8_t pmk[CFG_MAX_PMK_LEN];
 	uint8_t pmk_len;
+	uint16_t spmk_timeout_period;
+	qdf_time_t spmk_timestamp;
 };
 
 /**

+ 10 - 6
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3699,6 +3699,8 @@ char *mlme_get_roam_trigger_str(uint32_t roam_scan_trigger)
 		return "WTC BTM";
 	case WMI_ROAM_TRIGGER_REASON_NONE:
 		return "NONE";
+	case WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT:
+		return "PMK Expired";
 	default:
 		return "UNKNOWN";
 	}
@@ -3778,7 +3780,7 @@ void wlan_mlme_get_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
 				       struct wlan_mlme_sae_single_pmk *pmksa)
 {
 	struct mlme_legacy_priv *mlme_priv;
-	struct mlme_pmk_info pmk_info;
+	struct mlme_pmk_info *pmk_info;
 
 	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
 	if (!mlme_priv) {
@@ -3786,15 +3788,17 @@ void wlan_mlme_get_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
 		return;
 	}
 
-	pmk_info = mlme_priv->mlme_roam.sae_single_pmk.pmk_info;
+	pmk_info = &mlme_priv->mlme_roam.sae_single_pmk.pmk_info;
 
 	pmksa->sae_single_pmk_ap =
 		mlme_priv->mlme_roam.sae_single_pmk.sae_single_pmk_ap;
+	pmksa->pmk_info.spmk_timeout_period = pmk_info->spmk_timeout_period;
+	pmksa->pmk_info.spmk_timestamp = pmk_info->spmk_timestamp;
 
-	if (pmk_info.pmk_len) {
-		qdf_mem_copy(pmksa->pmk_info.pmk, pmk_info.pmk,
-			     pmk_info.pmk_len);
-		pmksa->pmk_info.pmk_len = pmk_info.pmk_len;
+	if (pmk_info->pmk_len) {
+		qdf_mem_copy(pmksa->pmk_info.pmk, pmk_info->pmk,
+			     pmk_info->pmk_len);
+		pmksa->pmk_info.pmk_len = pmk_info->pmk_len;
 		return;
 	}
 

+ 41 - 12
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -239,25 +239,40 @@ cm_update_rso_ese_info(struct rso_config *rso_cfg,
 
 #ifdef WLAN_SAE_SINGLE_PMK
 static bool
-csr_cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
-				    struct wlan_mlme_psoc_ext_obj *mlme_obj,
-				    struct wlan_rso_11i_params *rso_11i_info)
+cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
+				struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				struct wlan_roam_scan_offload_params *rso_cfg)
 {
-	struct wlan_mlme_sae_single_pmk single_pmk;
+	struct wlan_mlme_sae_single_pmk single_pmk = {0};
+	struct wlan_rso_11i_params *rso_11i_info = &rso_cfg->rso_11i_info;
+	uint64_t time_expired;
 
 	wlan_mlme_get_sae_single_pmk_info(vdev, &single_pmk);
 
 	if (single_pmk.pmk_info.pmk_len && single_pmk.sae_single_pmk_ap &&
 	    mlme_obj->cfg.lfr.sae_single_pmk_feature_enabled) {
-		mlme_debug("Update pmk with len %d same_pmk_info %d",
-			  single_pmk.pmk_info.pmk_len,
-			  single_pmk.sae_single_pmk_ap);
 
 		rso_11i_info->pmk_len = single_pmk.pmk_info.pmk_len;
 		/* Update sae same pmk info in rso */
 		qdf_mem_copy(rso_11i_info->psk_pmk, single_pmk.pmk_info.pmk,
 			     rso_11i_info->pmk_len);
 		rso_11i_info->is_sae_same_pmk = single_pmk.sae_single_pmk_ap;
+
+		/* get the time expired in seconds */
+		time_expired = (qdf_get_system_timestamp() -
+				single_pmk.pmk_info.spmk_timestamp) / 1000;
+
+		rso_cfg->sae_offload_params.spmk_timeout = 0;
+		if (time_expired < single_pmk.pmk_info.spmk_timeout_period)
+			rso_cfg->sae_offload_params.spmk_timeout =
+				(single_pmk.pmk_info.spmk_timeout_period  -
+				 time_expired);
+
+		mlme_debug("Update spmk with len:%d is_spmk_ap:%d time_exp:%lld time left:%d",
+			   single_pmk.pmk_info.pmk_len,
+			   single_pmk.sae_single_pmk_ap, time_expired,
+			   rso_cfg->sae_offload_params.spmk_timeout);
+
 		return true;
 	}
 
@@ -265,9 +280,9 @@ csr_cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
 }
 #else
 static inline bool
-csr_cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
-				    struct wlan_mlme_psoc_ext_obj *mlme_obj,
-				    struct wlan_rso_11i_params *rso_11i_info)
+cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
+				struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				struct wlan_roam_scan_offload_params *rso_cfg)
 {
 	return false;
 }
@@ -433,8 +448,7 @@ cm_roam_scan_offload_fill_lfr3_config(struct wlan_objmgr_vdev *vdev,
 			(pmkid_modes & CFG_PMKID_MODES_PMKSA_CACHING) ? 1 : 0;
 
 	/* Check whether to send psk_pmk or sae_single pmk info */
-	if (!csr_cm_fill_rso_sae_single_pmk_info(vdev, mlme_obj,
-						 &rso_config->rso_11i_info)) {
+	if (!cm_fill_rso_sae_single_pmk_info(vdev, mlme_obj, rso_config)) {
 		rso_config->rso_11i_info.is_sae_same_pmk = false;
 		wlan_cm_get_psk_pmk(pdev, vdev_id,
 				    rso_config->rso_11i_info.psk_pmk,
@@ -3450,6 +3464,7 @@ cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
 					struct wlan_objmgr_vdev *vdev)
 {
 	struct mlme_pmk_info *pmk_info;
+	struct wlan_crypto_pmksa *pmksa;
 	struct cm_roam_values_copy src_cfg;
 	struct qdf_mac_addr bssid;
 	uint8_t vdev_id = wlan_vdev_get_id(vdev);
@@ -3470,6 +3485,20 @@ cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
 
 	wlan_cm_get_psk_pmk(pdev, vdev_id, pmk_info->pmk, &pmk_info->pmk_len);
 
+	pmksa = wlan_crypto_get_pmksa(vdev, &bssid);
+	if (pmksa) {
+		pmk_info->spmk_timeout_period =
+			(pmksa->pmk_lifetime *
+			 pmksa->pmk_lifetime_threshold / 100);
+		pmk_info->spmk_timestamp = pmksa->pmk_entry_ts;
+		mlme_debug("spmk_ts:%ld spmk_timeout_prd:%d secs",
+			   pmk_info->spmk_timestamp,
+			   pmk_info->spmk_timeout_period);
+	} else {
+		mlme_debug("PMK entry not found for bss:" QDF_MAC_ADDR_FMT,
+			   QDF_MAC_ADDR_REF(bssid.bytes));
+	}
+
 	wlan_mlme_update_sae_single_pmk(vdev, pmk_info);
 
 	qdf_mem_zero(pmk_info, sizeof(*pmk_info));

+ 15 - 2
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -584,8 +584,8 @@ struct scoring_param {
 };
 
 /*
- * Currently roam score delta value and min rssi values are sent
- * for 2 triggers
+ * Currently roam score delta value is sent for 2 triggers and min rssi
+ * values are sent for 3 triggers
  */
 #define NUM_OF_ROAM_TRIGGERS 2
 #define IDLE_ROAM_TRIGGER 0
@@ -625,6 +625,7 @@ struct scoring_param {
  * ROAM_TRIGGER_REASON_STA_KICKOUT: Roam triggered due to sta kickout event.
  * ROAM_TRIGGER_REASON_ESS_RSSI: Roam triggered due to ess rssi
  * ROAM_TRIGGER_REASON_WTC_BTM: Roam triggered due to WTC BTM
+ * ROAM_TRIGGER_REASON_PMK_TIMEOUT: Roam triggered due to PMK expiry
  * ROAM_TRIGGER_REASON_MAX: Maximum number of roam triggers
  */
 enum roam_trigger_reason {
@@ -646,6 +647,7 @@ enum roam_trigger_reason {
 	ROAM_TRIGGER_REASON_STA_KICKOUT,
 	ROAM_TRIGGER_REASON_ESS_RSSI,
 	ROAM_TRIGGER_REASON_WTC_BTM,
+	ROAM_TRIGGER_REASON_PMK_TIMEOUT,
 	ROAM_TRIGGER_REASON_MAX,
 };
 
@@ -1162,6 +1164,15 @@ struct wlan_rso_ese_params {
 	uint8_t krk[WMI_KRK_KEY_LEN];
 	uint8_t btk[WMI_BTK_KEY_LEN];
 };
+
+/**
+ * struct wlan_rso_sae_offload_params - SAE authentication offload related
+ * parameters.
+ * @spmk_timeout: Single PMK timeout value in seconds.
+ */
+struct wlan_rso_sae_offload_params {
+	uint32_t spmk_timeout;
+};
 #endif
 
 #define ROAM_SCAN_DWELL_TIME_ACTIVE_DEFAULT   (100)
@@ -1190,6 +1201,7 @@ struct wlan_rso_ese_params {
  * @rso_11r_info: FT related parameters
  * @rso_ese_info: ESE related parameters
  * @fils_roam_config: roam fils params
+ * @sae_offload_params: SAE offload/single pmk related parameters
  */
 struct wlan_roam_scan_offload_params {
 	uint32_t vdev_id;
@@ -1213,6 +1225,7 @@ struct wlan_roam_scan_offload_params {
 #ifdef WLAN_FEATURE_FILS_SK
 	struct wlan_roam_fils_params fils_roam_config;
 #endif
+	struct wlan_rso_sae_offload_params sae_offload_params;
 #endif
 };
 

+ 75 - 6
components/wmi/src/wmi_unified_roam_tlv.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2021, The Linux Foundation. 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 above
@@ -1095,6 +1095,9 @@ convert_control_roam_trigger_reason_bitmap(uint32_t trigger_reason_bitmap)
 	if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_WTC_BTM))
 		fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_WTC_BTM);
 
+	if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_PMK_TIMEOUT))
+		fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT);
+
 	return fw_trigger_bitmap;
 }
 
@@ -1200,7 +1203,7 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle,
 	if (BIT(ROAM_TRIGGER_REASON_BSS_LOAD) & roam_scan_scheme_bitmap)
 		num_triggers_enabled++;
 
-	total_tlv_len = sizeof(wmi_configure_roam_trigger_parameters) +
+	total_tlv_len = 2 * sizeof(wmi_configure_roam_trigger_parameters) +
 			num_triggers_enabled *
 			sizeof(wmi_configure_roam_trigger_parameters);
 	len += WMI_TLV_HDR_SIZE + total_tlv_len;
@@ -1257,6 +1260,19 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle,
 
 	roam_trigger_parameters++;
 
+	wmi_fill_default_roam_trigger_parameters(
+				roam_trigger_parameters,
+				WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT);
+
+	if (cmd->trigger_reason_bitmask &
+	    BIT(WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT))
+		roam_trigger_parameters->enable = 1;
+	else
+		roam_trigger_parameters->enable = 0;
+
+	roam_trigger_parameters->roam_score_delta_percentage = 0;
+	roam_trigger_parameters++;
+
 	if (num_triggers_enabled == 0)
 		goto send;
 
@@ -1658,11 +1674,17 @@ wmi_get_rso_buf_len(struct wlan_roam_scan_offload_params *roam_req)
 	buf_len += (sizeof(*assoc_ies) + (2 * WMI_TLV_HDR_SIZE) +
 		    roundup(roam_req->assoc_ie_length, sizeof(uint32_t)));
 
+	/* Fils TLV */
+	buf_len += WMI_TLV_HDR_SIZE;
 	if (roam_req->add_fils_tlv) {
 		fils_tlv_len = sizeof(wmi_roam_fils_offload_tlv_param);
-		buf_len += WMI_TLV_HDR_SIZE + fils_tlv_len;
+		buf_len += fils_tlv_len;
 	}
 
+	if (roam_req->rso_11i_info.is_sae_same_pmk)
+		buf_len += WMI_TLV_HDR_SIZE +
+			   sizeof(wmi_roam_sae_offload_tlv_param);
+
 	roam_req->rso_mode_info.roam_scan_mode |=
 			WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
 
@@ -1687,8 +1709,11 @@ static uint8_t *wmi_add_fils_tlv(wmi_unified_t wmi_handle,
 	wmi_erp_info *erp_info;
 	struct wlan_roam_fils_params *roam_fils_params;
 
-	if (!roam_req->add_fils_tlv)
+	if (!roam_req->add_fils_tlv) {
+		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+		buf_ptr += WMI_TLV_HDR_SIZE;
 		return buf_ptr;
+	}
 
 	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
 		       sizeof(*fils_tlv));
@@ -1747,11 +1772,45 @@ wmi_fill_sae_single_pmk_param(struct wlan_rso_11i_params *src_11i,
 		roam_offload_11i->flags |=
 			1 << WMI_ROAM_OFFLOAD_FLAG_SAE_SAME_PMKID;
 }
+
+static uint8_t *wmi_fill_sae_single_pmk_tlv(
+	struct wlan_roam_scan_offload_params *roam_req, uint8_t *buf_ptr)
+{
+	wmi_roam_sae_offload_tlv_param *sae_offload_param;
+
+	if (!roam_req->rso_11i_info.is_sae_same_pmk)
+		return buf_ptr;
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+		       sizeof(wmi_roam_sae_offload_tlv_param));
+	buf_ptr += WMI_TLV_HDR_SIZE;
+
+	sae_offload_param = (wmi_roam_sae_offload_tlv_param *)buf_ptr;
+	WMITLV_SET_HDR(&sae_offload_param->tlv_header,
+	WMITLV_TAG_STRUC_wmi_roam_sae_offload_tlv_param,
+	WMITLV_GET_STRUCT_TLVLEN(wmi_roam_sae_offload_tlv_param));
+
+	sae_offload_param->spmk_timeout =
+			roam_req->sae_offload_params.spmk_timeout;
+	wmi_debug("spmk_timeout:%d seconds", sae_offload_param->spmk_timeout);
+
+	buf_ptr += sizeof(*sae_offload_param);
+
+	return buf_ptr;
+}
 #else
 static inline void
 wmi_fill_sae_single_pmk_param(struct wlan_rso_11i_params *src_11i,
 			      wmi_roam_11i_offload_tlv_param *roam_offload_11i)
 {}
+
+static inline uint8_t *wmi_fill_sae_single_pmk_tlv(
+		struct wlan_roam_scan_offload_params *roam_req,
+		uint8_t *buf_ptr)
+{
+	return buf_ptr;
+}
+
 #endif
 
 static QDF_STATUS
@@ -2052,6 +2111,8 @@ wmi_fill_rso_tlvs(wmi_unified_t wmi_handle, uint8_t *buf,
 	buf += qdf_roundup(assoc_ies->buf_len, sizeof(uint32_t));
 	buf = wmi_add_fils_tlv(wmi_handle, roam_req, buf, fils_tlv_len);
 
+	buf = wmi_fill_sae_single_pmk_tlv(roam_req, buf);
+
 	return QDF_STATUS_SUCCESS;
 }
 #else
@@ -2237,9 +2298,9 @@ send_roam_scan_mode_cmd:
  * enum to TLV specific WMI_ROAM_TRIGGER_REASON_ID
  * @reason: Roam trigger reason
  *
- * Return: WMI_ROAM_TRIGGER_REASON_ID
+ * Return: WMI roam trigger reason
  */
-static WMI_ROAM_TRIGGER_REASON_ID
+static uint32_t
 convert_roam_trigger_reason(enum roam_trigger_reason trigger_reason)
 {
 	switch (trigger_reason) {
@@ -2273,6 +2334,14 @@ convert_roam_trigger_reason(enum roam_trigger_reason trigger_reason)
 		return WMI_ROAM_TRIGGER_REASON_DEAUTH;
 	case ROAM_TRIGGER_REASON_IDLE:
 		return WMI_ROAM_TRIGGER_REASON_IDLE;
+	case ROAM_TRIGGER_REASON_STA_KICKOUT:
+		return WMI_ROAM_TRIGGER_REASON_STA_KICKOUT;
+	case ROAM_TRIGGER_REASON_ESS_RSSI:
+		return WMI_ROAM_TRIGGER_REASON_ESS_RSSI;
+	case ROAM_TRIGGER_REASON_WTC_BTM:
+		return WMI_ROAM_TRIGGER_REASON_WTC_BTM;
+	case ROAM_TRIGGER_REASON_PMK_TIMEOUT:
+		return WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT;
 	case ROAM_TRIGGER_REASON_MAX:
 		return WMI_ROAM_TRIGGER_REASON_MAX;
 	default:

+ 31 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -21783,6 +21783,32 @@ static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
 	return errno;
 }
 
+#if (defined(CFG80211_CONFIG_PMKSA_TIMER_PARAMS_SUPPORT) || \
+	     (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)))
+static inline void
+hdd_fill_pmksa_lifetime(struct cfg80211_pmksa *pmksa,
+			tPmkidCacheInfo *pmk_cache)
+{
+	pmk_cache->pmk_lifetime = pmksa->pmk_lifetime;
+	if (pmk_cache->pmk_lifetime > WLAN_CRYPTO_MAX_PMKID_LIFETIME)
+		pmk_cache->pmk_lifetime = WLAN_CRYPTO_MAX_PMKID_LIFETIME;
+
+	pmk_cache->pmk_lifetime_threshold = pmksa->pmk_reauth_threshold;
+	if (pmk_cache->pmk_lifetime_threshold >=
+	    WLAN_CRYPTO_MAX_PMKID_LIFETIME_THRESHOLD)
+		pmk_cache->pmk_lifetime_threshold =
+			WLAN_CRYPTO_MAX_PMKID_LIFETIME_THRESHOLD - 1;
+
+	hdd_debug("PMKSA: lifetime:%d threshold:%d",  pmk_cache->pmk_lifetime,
+		  pmk_cache->pmk_lifetime_threshold);
+}
+#else
+static inline void
+hdd_fill_pmksa_lifetime(struct cfg80211_pmksa *pmksa,
+			tPmkidCacheInfo *src_pmk_cache)
+{}
+#endif
+
 static QDF_STATUS wlan_hdd_set_pmksa_cache(struct hdd_adapter *adapter,
 					   tPmkidCacheInfo *pmk_cache)
 {
@@ -21823,6 +21849,9 @@ static QDF_STATUS wlan_hdd_set_pmksa_cache(struct hdd_adapter *adapter,
 	qdf_mem_copy(pmksa->pmkid, pmk_cache->PMKID, PMKID_LEN);
 	qdf_mem_copy(pmksa->pmk, pmk_cache->pmk, pmk_cache->pmk_len);
 	pmksa->pmk_len = pmk_cache->pmk_len;
+	pmksa->pmk_entry_ts = qdf_get_system_timestamp();
+	pmksa->pmk_lifetime = pmk_cache->pmk_lifetime;
+	pmksa->pmk_lifetime_threshold = pmk_cache->pmk_lifetime_threshold;
 
 	result = wlan_crypto_set_del_pmksa(vdev, pmksa, true);
 	if (result != QDF_STATUS_SUCCESS) {
@@ -21922,6 +21951,8 @@ static void hdd_fill_pmksa_info(struct hdd_adapter *adapter,
 			  pmk_cache->cache_id[1]);
 	}
 
+	hdd_fill_pmksa_lifetime(pmksa, pmk_cache);
+
 	if (is_delete)
 		return;
 

+ 3 - 0
core/sme/inc/csr_api.h

@@ -594,6 +594,9 @@ typedef struct tagPmkidCacheInfo {
 	uint8_t ssid_len;
 	uint8_t ssid[WLAN_SSID_MAX_LEN];
 	uint8_t cache_id[CACHE_ID_LEN];
+	uint32_t   pmk_lifetime;
+	uint8_t    pmk_lifetime_threshold;
+	qdf_time_t pmk_ts;
 } tPmkidCacheInfo;
 
 #ifdef FEATURE_WLAN_WAPI

+ 5 - 0
core/sme/src/csr/csr_api_roam.c

@@ -17426,6 +17426,11 @@ csr_check_and_set_sae_single_pmk_cap(struct mac_context *mac_ctx,
 			qdf_mem_copy(pmk_info->pmk, pmkid_cache->pmk,
 				     pmkid_cache->pmk_len);
 			pmk_info->pmk_len = pmkid_cache->pmk_len;
+			pmk_info->spmk_timestamp = pmkid_cache->pmk_ts;
+			pmk_info->spmk_timeout_period  =
+				(pmkid_cache->pmk_lifetime *
+				 pmkid_cache->pmk_lifetime_threshold / 100);
+
 			wlan_mlme_update_sae_single_pmk(vdev, pmk_info);
 
 			qdf_mem_zero(pmk_info, sizeof(*pmk_info));

+ 4 - 0
core/sme/src/csr/csr_util.c

@@ -2654,6 +2654,10 @@ bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
 	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, sizeof(pmk_cache->PMKID));
 	qdf_mem_copy(pmk_cache->pmk, pmksa->pmk, pmksa->pmk_len);
 	pmk_cache->pmk_len = pmksa->pmk_len;
+	pmk_cache->pmk_lifetime = pmksa->pmk_lifetime;
+	pmk_cache->pmk_lifetime_threshold = pmksa->pmk_lifetime_threshold;
+	pmk_cache->pmk_ts = pmksa->pmk_entry_ts;
+
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
 	return true;