소스 검색

qcacld-3.0: Check privilege permission for QCSAP_IOCTL_DISASSOC_STA

qcacld-2.0 to qcacld-3.0 propagation

Kernel assumes all SET IOCTL commands are assigned with even
numbers. But in our WLAN driver, some SET IOCTLS are assigned with
odd numbers. This leads kernel fail to check, for some SET IOCTLs,
whether user has the right permission to do SET operation.
Hence, in driver, before processing QCSAP_IOCTL_DISASSOC_STA IOCTL,
making sure user task has right permission to process the command.

Change-Id: I00919a56e93b8b49bce7a314b50f9f48039fbe6f
CRs-Fixed: 930946
Mukul Sharma 9 년 전
부모
커밋
744420f213
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      core/hdd/src/wlan_hdd_hostapd.c

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

@@ -3379,6 +3379,12 @@ static __iw_softap_disassoc_sta(struct net_device *dev,
 
 	ENTER();
 
+	if (!capable(CAP_NET_ADMIN)) {
+		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
+			FL("permission check failed"));
+		return -EPERM;
+	}
+
 	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
 	ret = wlan_hdd_validate_context(hdd_ctx);
 	if (0 != ret)