浏览代码

qcacld-3.0: Trim extn capability to max supported in change station

qcacld-2.0 to qcacld-3.0 Propagation.

extn capabilities can be controlled by user, which can
be sent greater than the max supported value. This results
in stack overflow in change station command.

Add check to validate extn capability param given by user
and if it exceeds max supported value, set it to max supported
value.

CRs-Fixed: 2076664
Change-Id: I531799dd06c41069e85ad969de6182363dbf9f05
SaidiReddy Yenuga 8 年之前
父节点
当前提交
f098d8ea2e
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      core/hdd/src/wlan_hdd_cfg80211.c

+ 8 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -13445,10 +13445,17 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
 			StaParams.supported_oper_classes_len =
 				params->supported_oper_classes_len;
 
+			if (params->ext_capab_len >
+			    sizeof(StaParams.extn_capability)) {
+				hdd_debug("received extn capabilities:%d, resetting it to max supported",
+					  params->ext_capab_len);
+				params->ext_capab_len =
+					sizeof(StaParams.extn_capability);
+			}
 			if (0 != params->ext_capab_len)
 				qdf_mem_copy(StaParams.extn_capability,
 					     params->ext_capab,
-					     sizeof(StaParams.extn_capability));
+					     params->ext_capab_len);
 
 			if (NULL != params->ht_capa) {
 				StaParams.htcap_present = 1;