瀏覽代碼

qcacld-3.0: Trim operation classes to max supported in change station

Operation classes supported can be controlled by user, which can
be sent greater than the max supported operations. This results
in stack overflow in change station command.
Add check to validate operations supported param given by user
and if it exceeds max supported value, set it to max supported
value.

CRs-Fixed: 2002052
Change-Id: Idd3a35e38b091546a17d7ec6329f19429e5c289c
Bala Venkatesh 6 年之前
父節點
當前提交
4f9ba364ed
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      os_if/tdls/src/wlan_cfg80211_tdls.c

+ 7 - 0
os_if/tdls/src/wlan_cfg80211_tdls.c

@@ -334,6 +334,13 @@ wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
 	if (params->supported_channels_len)
 		tdls_calc_channels_from_staparams(req_info, params);
 
+	if (params->supported_oper_classes_len > WLAN_MAX_SUPP_OPER_CLASSES) {
+		cfg80211_debug("received oper classes:%d, resetting it to max supported: %d",
+			       params->supported_oper_classes_len,
+			       WLAN_MAX_SUPP_OPER_CLASSES);
+		params->supported_oper_classes_len = WLAN_MAX_SUPP_OPER_CLASSES;
+	}
+
 	qdf_mem_copy(req_info->supported_oper_classes,
 		     params->supported_oper_classes,
 		     params->supported_oper_classes_len);