Browse Source

qcacld-3.0: Reject scan cmd if ie length greater than max allowed

Firmware cannot handle scan IE more than a certain size owing to memory
restrictions. Check the scan IE length before passing params to firmware.

Change-Id: I73321a9d4932f4cbb876de904dacecf15c9083ff
CRs-Fixed: 2159363
Naveen Rawat 7 năm trước cách đây
mục cha
commit
7cc925c403
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      core/wma/src/wma_scan_roam.c

+ 6 - 0
core/wma/src/wma_scan_roam.c

@@ -202,6 +202,12 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	if (scan_req->uIEFieldLen > WLAN_SCAN_PARAMS_MAX_IE_LEN) {
+		WMA_LOGD(FL("scan_ie_len (%d) greater than max (%d)"),
+			scan_req->uIEFieldLen, WLAN_SCAN_PARAMS_MAX_IE_LEN);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	cmd->vdev_id = scan_req->sessionId;
 	/*
 	 * host cycles through the lower 12 bits for scan id generation