소스 검색

qcacld-3.0: Fix race condition between scan and SSR/driver unload

HDD validate context check is at wrong place in __wlan_hdd_cfg80211_scan()
which is leading to invalid pointer access and page fault. Move HDD
validate context check at begining of scan API to avoid accessing any
context pointer which is getting freed during SSR/driver unload.

Change-Id: Id91c9ea54c513ecc25bdf42904a5bb5cde2e91ce
CRs-Fixed: 1025498
Rajeev Kumar 9 년 전
부모
커밋
46d26b7fcf
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      core/hdd/src/wlan_hdd_scan.c

+ 5 - 4
core/hdd/src/wlan_hdd_scan.c

@@ -1271,6 +1271,11 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
+	status = wlan_hdd_validate_context(pHddCtx);
+
+	if (0 != status)
+		return status;
+
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
 			 TRACE_CODE_HDD_CFG80211_SCAN,
 			 pAdapter->sessionId, request->n_channels));
@@ -1282,10 +1287,6 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		hdd_device_mode_to_string(pAdapter->device_mode),
 		pAdapter->device_mode);
 
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
 
 	cfg_param = pHddCtx->config;
 	pScanInfo = &pAdapter->scan_info;