소스 검색

qcacmn: Check chain mask tables number valid

Chain mask tables number is from wmi service ready ext event, it is
not check valid which will cause oob read arry of chain mask tables.

Change-Id: I2fa0251358ed66d928477c0b55933ca028c8bd53
CRs-Fixed: 2331850
Wu Gao 6 년 전
부모
커밋
b9a832ec33
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      wmi/src/wmi_unified_tlv.c

+ 3 - 1
wmi/src/wmi_unified_tlv.c

@@ -23,6 +23,7 @@
 #include "wmi_version_whitelist.h"
 #include <qdf_module.h>
 #include <wlan_defs.h>
+#include <wlan_cmn.h>
 #include <htc_services.h>
 #ifdef FEATURE_WLAN_APF
 #include "wmi_unified_apf_tlv.h"
@@ -17045,7 +17046,8 @@ static QDF_STATUS extract_chainmask_tables_tlv(wmi_unified_t wmi_handle,
 	if (!hw_caps)
 		return QDF_STATUS_E_INVAL;
 
-	if (!hw_caps->num_chainmask_tables)
+	if ((!hw_caps->num_chainmask_tables) ||
+	    (hw_caps->num_chainmask_tables > PSOC_MAX_CHAINMASK_TABLES))
 		return QDF_STATUS_E_INVAL;
 
 	chainmask_caps = param_buf->mac_phy_chainmask_caps;