Kaynağa Gözat

qcacld-3.0: Reject FTM command unless device is in FTM mode

Currently, the device mode is not verified before servicing the FTM
command. Reject FTM commands unless the device is in FTM mode.

Change-Id: Ia27dbe5922755a94e80ddc1c5824b8082ae3325a
CRs-Fixed: 2051888
Dustin Brown 8 yıl önce
ebeveyn
işleme
ab6029b34a

+ 6 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -16994,6 +16994,12 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
 		int buf_len;
 		void *buf;
 		QDF_STATUS status;
+
+		if (hdd_get_conparam() != QDF_GLOBAL_FTM_MODE) {
+			hdd_err("Device is not in FTM mode");
+			return -EINVAL;
+		}
+
 		if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
 			hdd_err("WLAN_HDD_TM_ATTR_DATA attribute is invalid");
 			return -EINVAL;

+ 2 - 3
core/hdd/src/wlan_hdd_main.c

@@ -10979,17 +10979,16 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp,
 	enum tQDF_GLOBAL_CON_MODE curr_mode;
 	enum tQDF_ADAPTER_MODE adapter_mode;
 
+	hdd_info("con_mode handler: %s", kmessage);
+
 	ret = wlan_hdd_validate_context(hdd_ctx);
 	if (ret)
 		return ret;
 
 	cds_set_load_in_progress(true);
 
-	hdd_debug("con_mode handler: %s", kmessage);
 	ret = param_set_int(kmessage, kp);
 
-
-
 	if (!(is_con_mode_valid(con_mode))) {
 		hdd_err("invlaid con_mode %d", con_mode);
 		ret = -EINVAL;