Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
744420f213
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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)