소스 검색

qcacld-3.0: Add checks for the assoc req/res lengths

In some case assos req/res length can be less than their respective
fixed fields due to which they get assigned to negative value
but as they are unsigned variable these req/res lengths gets convert
to large positive values. So during page memory allocation for these
lengths, page memory allocation failure happens.

To address the above issue add checks for both assoc req/res lenghts
before calculating the value for them.

Change-Id: Iff404e72420b27bc2a467a25fe530f135ee97c91
CRs-Fixed: 2903644
Abdul Muqtadeer Ahmed 4 년 전
부모
커밋
5e3c6e4da0
1개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 12 4
      core/hdd/src/wlan_hdd_assoc.c

+ 12 - 4
core/hdd/src/wlan_hdd_assoc.c

@@ -2831,7 +2831,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 				(u8 *) (roam_info->pbFrames +
 					roam_info->nBeaconLength +
 					roam_info->nAssocReqLength);
-			if (assoc_rsp) {
+			if (assoc_rsp &&
+			    roam_info->nAssocRspLength >
+			    ASSOC_RSP_IES_OFFSET) {
 				/*
 				 * assoc_rsp needs to point to the IEs
 				 */
@@ -2850,7 +2852,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 			assoc_req = (u8 *) (roam_info->pbFrames +
 					      roam_info->nBeaconLength);
 			if (assoc_req) {
-				if (!ft_carrier_on) {
+				if (!ft_carrier_on &&
+				    roam_info->nAssocReqLength >
+				    ASSOC_REQ_IES_OFFSET) {
 					/*
 					 * assoc_req needs to point to
 					 * the IEs
@@ -3169,7 +3173,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 					/* Association Request */
 					assoc_req = (u8 *)(roam_info->pbFrames +
 						      roam_info->nBeaconLength);
-					if (assoc_req) {
+					if (assoc_req &&
+					    roam_info->nAssocReqLength >
+					    ASSOC_REQ_IES_OFFSET) {
 						/*
 						 * assoc_req needs to point to
 						 * the IEs
@@ -3188,7 +3194,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 					    (u8 *)(roam_info->pbFrames +
 						   roam_info->nBeaconLength +
 						   roam_info->nAssocReqLength);
-					if (assoc_rsp) {
+					if (assoc_rsp &&
+					    roam_info->nAssocRspLength >
+					    ASSOC_RSP_IES_OFFSET) {
 						/*
 						 * assoc_rsp needs to point to
 						 * the IEs