Эх сурвалжийг харах

qcacld-3.0: SAE: delete preauth node if it's present in list

In SAP mode, a preauth node is added to the preauth list when
assoc rejection happens due to some reason (e.g. blacklisting
the station BSSID). But when station tries SAE authentication,
host driver doesn't add/update the entry in preauth node list
as a node with same mac address is present in the list.

Host driver relies on the flag is_sae_authenticated to decide
whether to proceed with association or go for PMKID validation.
is_sae_authenticated is set to true only when SAE authentication
is completed and the node in preauth list has type as SAE.
But the preauth node added as part of assoc reject doesn't have
this info correct, which is disallows association as
is_sae_authenticated is not set. Fixing this here is
not a right way as the auth state also to be updated
to eLIM_MLM_WT_SAE_AUTH_STATE when first SAE auth frame
is received.
So, delete the existing preauth node and create a new one when
the first SAE auth frame is received to avoid stale entries.

Change-Id: I0acd72f960ba1de2a656b55a9805561322dfffe9
CRs-Fixed: 3135389
Srinivas Dasari 3 жил өмнө
parent
commit
5fd4b455f1

+ 12 - 7
core/mac/src/pe/lim/lim_process_auth_frame.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 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
@@ -432,7 +433,7 @@ static void lim_process_sae_auth_frame(struct mac_context *mac_ctx,
 		       pe_session->limMlmState);
 
 	if (LIM_IS_AP_ROLE(pe_session)) {
-		struct tLimPreAuthNode *sta_pre_auth_ctx;
+		struct tLimPreAuthNode *pre_auth_node;
 
 		rx_flags = RXMGMT_FLAG_EXTERNAL_AUTH;
 		/* Add preauth node when the first SAE authentication frame
@@ -442,12 +443,16 @@ static void lim_process_sae_auth_frame(struct mac_context *mac_ctx,
 		 * SAE protocol optimizations.
 		 */
 		/* Extract pre-auth context for the STA, if any. */
-		sta_pre_auth_ctx = lim_search_pre_auth_list(mac_ctx,
-							    mac_hdr->sa);
-		if (!sta_pre_auth_ctx ||
-		    (sta_pre_auth_ctx->mlmState != eLIM_MLM_WT_SAE_AUTH_STATE &&
-		     sta_pre_auth_ctx->mlmState !=
-		     eLIM_MLM_AUTHENTICATED_STATE)) {
+		pre_auth_node = lim_search_pre_auth_list(mac_ctx, mac_hdr->sa);
+		if (!pre_auth_node ||
+		    (pre_auth_node->mlmState != eLIM_MLM_WT_SAE_AUTH_STATE)) {
+			if (pre_auth_node) {
+				pe_debug("Delete existing preauth node for SAE peer in state: %u "
+					 QDF_MAC_ADDR_FMT,
+					 pre_auth_node->mlmState,
+					 QDF_MAC_ADDR_REF(mac_hdr->sa));
+				lim_delete_pre_auth_node(mac_ctx, mac_hdr->sa);
+			}
 			lim_external_auth_add_pre_auth_node(mac_ctx, mac_hdr,
 						eLIM_MLM_WT_SAE_AUTH_STATE);
 		}