瀏覽代碼

qcacld-3.0: Validate packet filter data offset

When configuring a packet filter request, ensure the provided data
offset values are less than the maximum data offset supported by
firmware.

Change-Id: I74ac672dd51245ab954457fdc87bd1e8421b3e1b
CRs-Fixed: 1101487
Dustin Brown 8 年之前
父節點
當前提交
4d1e846b92
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 9 0
      core/hdd/src/wlan_hdd_wext.c
  2. 1 0
      core/mac/inc/sir_api.h

+ 9 - 0
core/hdd/src/wlan_hdd_wext.c

@@ -8967,6 +8967,15 @@ static int wlan_hdd_set_filter(hdd_context_t *hdd_ctx,
 				request->params_data[i].data_length;
 			packetFilterSetReq.paramsData[i].reserved = 0;
 
+			if (request->params_data[i].data_offset >
+			    SIR_MAX_FILTER_TEST_DATA_OFFSET) {
+				hdd_err("Invalid data offset %u for param %d (max = %d)",
+					request->params_data[i].data_offset,
+					i,
+					SIR_MAX_FILTER_TEST_DATA_OFFSET);
+				return -EINVAL;
+			}
+
 			if (request->params_data[i].data_length >
 				SIR_MAX_FILTER_TEST_DATA_LEN) {
 				hdd_err("Error invalid data length %d",

+ 1 - 0
core/mac/inc/sir_api.h

@@ -3083,6 +3083,7 @@ typedef struct sSirRoamOffloadScanRsp {
    Packet Filtering Parameters
    ---------------------------------------------------------------------------*/
 #define    SIR_MAX_FILTER_TEST_DATA_LEN       8
+#define    SIR_MAX_FILTER_TEST_DATA_OFFSET  200
 #define    SIR_MAX_NUM_MULTICAST_ADDRESS    240
 #define    SIR_MAX_NUM_FILTERS               20
 #define    SIR_MAX_NUM_TESTS_PER_FILTER      10