From 3c6aa0c3f2c3f6cd759582d76f9ede494c085979 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Fri, 25 Mar 2022 17:24:24 +0530 Subject: [PATCH] qcacld-3.0: Drop duplicate auth/assoc frames Currently duplicate authentication frames are dropped if the sequence number is same previously processed auth frame and retry bit is set. To stop the flooding of auth frames with same sequence number, check the previous seq number stored on the preauth node and drop if the frame is a duplicate. Currently, for PMF-capable peers the duplicate assoc request frames are getting processed before the key is plumbed because the is_key_installed flag is not reset properly before assigning the dp hash node to a new sta. Therefore, reset the is_key_installed flag for every new dp hash node addition. Change-Id: Id035a5ba5ffe9b745361956d05496f9905bf2526 CRs-Fixed: 3155517 --- core/mac/src/dph/dph_hash_table.c | 2 ++ core/mac/src/pe/lim/lim_process_auth_frame.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c index 783f35383a0f..71e24d967185 100644 --- a/core/mac/src/dph/dph_hash_table.c +++ b/core/mac/src/dph/dph_hash_table.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 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 @@ -198,6 +199,7 @@ tpDphHashNode dph_init_sta_state(struct mac_context *mac, tSirMacAddr staAddr, sta->is_disassoc_deauth_in_progress = 0; sta->sta_deletion_in_progress = false; sta->valid = 1; + sta->is_key_installed = 0; return sta; } diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index 607555e8c5e2..15a733a5c762 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -1332,6 +1332,14 @@ lim_process_auth_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, return; } + /* Duplicate Auth frame from peer */ + auth_node = lim_search_pre_auth_list(mac_ctx, mac_hdr->sa); + if (auth_node && (auth_node->seq_num == curr_seq_num)) { + pe_err("Received an already processed auth frame with seq_num : %d", + curr_seq_num); + return; + } + /* save seq number and mac_addr in pe_session */ pe_session->prev_auth_seq_num = curr_seq_num; qdf_mem_copy(pe_session->prev_auth_mac_addr, mac_hdr->sa, ETH_ALEN); @@ -1463,7 +1471,6 @@ lim_process_auth_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, * Authentication frame3 and there is a context for requesting * STA. If not, reject with unspecified failure status code */ - auth_node = lim_search_pre_auth_list(mac_ctx, mac_hdr->sa); if (!auth_node) { pe_err("rx Auth frame with no preauth ctx with WEP bit set " QDF_MAC_ADDR_FMT,