瀏覽代碼

qcacmn: Clear saved keys during ml dev initialization

Issue happens during following scenario:
1. Connecting to ML AP1 (with SSID1) and disconnect.
2. Connecting to ML AP2 (with SSID2), as part of that vdev
 is destroyed and created but stored keys for AP1 are not reset.
3. Disconnect for ML AP2.
4. Connect to ML AP1.

Now host driver sends stored keys FW instead of the newly
generated keys sent by supplicant.

To fix this during ML dev initialization
clear the stored keys.

CRs-Fixed: 3649214
Change-Id: Ibffeb8b3108bf353e9140cbc901f99f08d9b0449
Amruta Kulkarni 1 年之前
父節點
當前提交
5fdc1a6c52

+ 8 - 3
umac/mlo_mgr/inc/wlan_mlo_mgr_link_switch.h

@@ -188,12 +188,14 @@ mlo_mgr_update_link_info_mac_addr(struct wlan_objmgr_vdev *vdev,
 
 /**
  * mlo_mgr_update_link_info_reset() - Reset link info of ml dev context
+ * @psoc: psoc pointer
  * @ml_dev: MLO device context
  *
  * Reset link info of ml links
  * Return: QDF_STATUS
  */
-void mlo_mgr_update_link_info_reset(struct wlan_mlo_dev_context *ml_dev);
+void mlo_mgr_update_link_info_reset(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_mlo_dev_context *ml_dev);
 
 /**
  * mlo_mgr_update_ap_link_info() - Update AP links information
@@ -594,6 +596,7 @@ mlo_mgr_link_switch_defer_disconnect_req(struct wlan_objmgr_vdev *vdev,
 
 /**
  * mlo_mgr_link_switch_init() - API to initialize link switch
+ * @psoc: PSOC object manager
  * @ml_dev: MLO dev context
  *
  * Initializes the MLO link context in @ml_dev and allocates various
@@ -601,7 +604,8 @@ mlo_mgr_link_switch_defer_disconnect_req(struct wlan_objmgr_vdev *vdev,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS mlo_mgr_link_switch_init(struct wlan_mlo_dev_context *ml_dev);
+QDF_STATUS mlo_mgr_link_switch_init(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_mlo_dev_context *ml_dev);
 
 /**
  * mlo_mgr_link_switch_deinit() - API to de-initialize link switch
@@ -673,7 +677,8 @@ mlo_mgr_link_switch_deinit(struct wlan_mlo_dev_context *ml_dev)
 }
 
 static inline QDF_STATUS
-mlo_mgr_link_switch_init(struct wlan_mlo_dev_context *ml_dev)
+mlo_mgr_link_switch_init(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_mlo_dev_context *ml_dev)
 {
 	return QDF_STATUS_SUCCESS;
 }

+ 11 - 3
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -147,7 +147,8 @@ void mlo_mgr_update_ap_channel_info(struct wlan_objmgr_vdev *vdev, uint8_t link_
 		  link_info->link_chan_info->ch_phymode);
 }
 
-void mlo_mgr_update_link_info_reset(struct wlan_mlo_dev_context *ml_dev)
+void mlo_mgr_update_link_info_reset(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_mlo_dev_context *ml_dev)
 {
 	struct mlo_link_info *link_info;
 	uint8_t link_info_iter;
@@ -159,6 +160,12 @@ void mlo_mgr_update_link_info_reset(struct wlan_mlo_dev_context *ml_dev)
 
 	for (link_info_iter = 0; link_info_iter < WLAN_MAX_ML_BSS_LINKS;
 	     link_info_iter++) {
+		if (!qdf_is_macaddr_zero(&link_info->ap_link_addr) &&
+		    !qdf_is_macaddr_zero(&link_info->link_addr))
+			wlan_crypto_free_key_by_link_id(
+						psoc,
+						&link_info->link_addr,
+						link_info->link_id);
 		qdf_mem_zero(&link_info->link_addr, QDF_MAC_ADDR_SIZE);
 		qdf_mem_zero(&link_info->ap_link_addr, QDF_MAC_ADDR_SIZE);
 		qdf_mem_zero(link_info->link_chan_info,
@@ -531,7 +538,8 @@ mlo_mgr_link_switch_notification(struct wlan_objmgr_vdev *vdev,
 	return status;
 }
 
-QDF_STATUS mlo_mgr_link_switch_init(struct wlan_mlo_dev_context *ml_dev)
+QDF_STATUS mlo_mgr_link_switch_init(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_mlo_dev_context *ml_dev)
 {
 	ml_dev->link_ctx =
 		qdf_mem_malloc(sizeof(struct mlo_link_switch_context));
@@ -541,7 +549,7 @@ QDF_STATUS mlo_mgr_link_switch_init(struct wlan_mlo_dev_context *ml_dev)
 
 	mlo_mgr_link_switch_init_state(ml_dev);
 	mlo_mgr_alloc_link_info_wmi_chan(ml_dev);
-	mlo_mgr_update_link_info_reset(ml_dev);
+	mlo_mgr_update_link_info_reset(psoc, ml_dev);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 1 - 1
umac/mlo_mgr/src/wlan_mlo_mgr_main.c

@@ -1222,7 +1222,7 @@ static QDF_STATUS mlo_dev_ctx_init(struct wlan_objmgr_vdev *vdev)
 	mlo_t2lm_ctx_init(ml_dev, vdev);
 	mlo_epcs_ctx_init(ml_dev);
 	mlo_ptqm_migration_init(ml_dev);
-	mlo_mgr_link_switch_init(ml_dev);
+	mlo_mgr_link_switch_init(psoc, ml_dev);
 
 	return status;
 }