From 05c914ff290437675fcddde00a1ebdc3863ac2dc Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 6 Aug 2018 12:23:58 -0700 Subject: [PATCH] qcacld-3.0: Don't process excessive duplicate auth mgmt frames When PEER sends auth mgmt frame to DUT and if DUT doesn't ACK back, PEER sends auth frame again and again till it gets ACK or timeout occurs. It has been observed that in busy environment, PEER ends up sending same AUTH frame almost 100+ times within 20ms apart due to ACK lost. in such scenario DUT gets busy processing AUTH frames from PE queue and other low priority queues suffer from starvation. to fix the situation, drop duplicate auth frames by checking retry field and sequence number. CRs-Fixed: 2290133 Change-Id: I1b545dab4d416facc24c3762b86cd1e73981de5c --- core/mac/src/pe/include/lim_api.h | 1 + core/mac/src/pe/lim/lim_api.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index e24fba26d229..4bb6e649f78f 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -102,6 +102,7 @@ typedef enum eMgmtFrmDropReason { eMGMT_DROP_NON_SCAN_MODE_FRAME, eMGMT_DROP_INVALID_SIZE, eMGMT_DROP_SPURIOUS_FRAME, + eMGMT_DROP_DUPLICATE_AUTH_FRAME, } tMgmtFrmDropReason; /** diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 713a73222901..6dbc21c5d048 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -46,6 +46,7 @@ #include "lim_ibss_peer_mgmt.h" #include "lim_admit_control.h" #include "lim_send_sme_rsp_messages.h" +#include "lim_security_utils.h" #include "wmm_apsd.h" #include "lim_trace.h" #include "lim_ft_defs.h" @@ -2604,6 +2605,25 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac, /* Drop the Probe Request in IBSS mode, if STA did not send out the last beacon */ /* In IBSS, the node which sends out the beacon, is supposed to respond to ProbeReq */ return eMGMT_DROP_NOT_LAST_IBSS_BCN; + } else if (subType == SIR_MAC_MGMT_AUTH) { + uint16_t curr_seq_num = 0; + struct tLimPreAuthNode *auth_node; + + pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); + psessionEntry = pe_find_session_by_bssid(pMac, pHdr->bssId, + &sessionId); + if (!psessionEntry) + return eMGMT_DROP_NO_DROP; + + curr_seq_num = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + auth_node = lim_search_pre_auth_list(pMac, pHdr->sa); + if (auth_node && pHdr->fc.retry && + (auth_node->seq_num == curr_seq_num)) { + pe_err_rl("auth frame, seq num: %d is already processed, drop it", + curr_seq_num); + return eMGMT_DROP_DUPLICATE_AUTH_FRAME; + } } return eMGMT_DROP_NO_DROP;