Explorar el Código

qcacld-3.0: Fix tdls vdev ref issue for race condition

When wpa_supplicant adds tdls peer during sta disconnecting,
scheduler thread clear MLO flag of vdev0, in wlan_key_get_link_vdev,
wlan_vdev_mlme_is_mlo_vdev(vdev0) return true, in
wlan_key_put_link_vdev, wlan_vdev_mlme_is_mlo_vdev(vdev0) return false,
WLAN_OSIF_TDLS_ID vdev ref count is released in both
wlan_key_get_link_vdev and wlan_key_put_link_vdev, while
WLAN_MLO_MGR_ID vdev ref count isn't released, assert will happen.

To fix it, add check in os_if, if vdev not up, reject tdls add peer to
avoid such race condition issue.

Change-Id: I851b269ee4a5649fe76cfa1fc6762b6ca41b0884
CRs-Fixed: 3598336
Paul Zhang hace 1 año
padre
commit
d72ae0d216
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      os_if/tdls/src/wlan_cfg80211_tdls.c

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

@@ -176,6 +176,12 @@ int wlan_cfg80211_tdls_add_peer_mlo(struct hdd_adapter *adapter,
 	if (!vdev)
 		return -EINVAL;
 
+	if (wlan_vdev_is_up(vdev) != QDF_STATUS_SUCCESS) {
+		osif_debug("sta is not connected or disconnecting");
+		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_TDLS_ID);
+		return -EINVAL;
+	}
+
 	is_mlo_vdev = wlan_vdev_mlme_is_mlo_vdev(vdev);
 	if (is_mlo_vdev) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_TDLS_ID);