From 9890619d291dc82838c3eeb7944471270afc45d4 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 18 May 2017 12:54:23 +0530 Subject: [PATCH] qcacld-3.0: Drop assoc request if RSNIE/WPAIE parsing fail Add changes to drop assoc request and return error if RSNIE or WPAIE parsing fail during parsing of assoc request. CRs-Fixed: 2046578 Change-Id: I88d779399c2eba5d33c30144bf9600a1f3a00b77 --- .../mac/src/pe/lim/lim_process_assoc_req_frame.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index 75bd20cd0e3d..01098660216d 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -776,10 +776,14 @@ static bool lim_chk_n_process_wpa_rsn_ie(tpAniSirGlobal mac_ctx, if (assoc_req->rsnPresent) { if (assoc_req->rsn.length) { /* Unpack the RSN IE */ - dot11f_unpack_ie_rsn(mac_ctx, + if (dot11f_unpack_ie_rsn(mac_ctx, &assoc_req->rsn.info[0], assoc_req->rsn.length, - &dot11f_ie_rsn, false); + &dot11f_ie_rsn, false) != + DOT11F_PARSE_SUCCESS) { + pe_err("Invalid RSN ie"); + return false; + } /* Check RSN version is supported */ if (SIR_MAC_OUI_VERSION_1 == @@ -847,10 +851,14 @@ static bool lim_chk_n_process_wpa_rsn_ie(tpAniSirGlobal mac_ctx, /* Unpack the WPA IE */ if (assoc_req->wpa.length) { /* OUI is not taken care */ - dot11f_unpack_ie_wpa(mac_ctx, + if (dot11f_unpack_ie_wpa(mac_ctx, &assoc_req->wpa.info[4], assoc_req->wpa.length, - &dot11f_ie_wpa, false); + &dot11f_ie_wpa, false) != + DOT11F_PARSE_SUCCESS) { + pe_err("Invalid WPA IE"); + return false; + } /* * check the groupwise and pairwise * cipher suites