Просмотр исходного кода

qcacld-3.0: Allow monitor mode vendor cmd only if mon iface is created

QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE is used to set the
config for packet capture feature on STA interface.
Currently this vendor command is allowed even if monitor interface
which will be used in packet capture mode is not created, which is
wrong.

To fix this, allow monitor mode config related to packet capture
feature only if monitor interface is created.

Change-Id: Iea94b4cd5f21d8ce13643c209d4027972d7a16d3
CRs-Fixed: 3256298
Surabhi Vishnoi 2 лет назад
Родитель
Сommit
7ec19a2b9a
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -16807,7 +16807,8 @@ __wlan_hdd_cfg80211_set_monitor_mode(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc))
+	if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc) ||
+	    !hdd_is_pkt_capture_mon_enable(adapter))
 		return -EPERM;
 
 	errno = hdd_validate_adapter(adapter);