Parcourir la source

qcacld-3.0: Check priviledge permission for SET_BAND_CONFIG IOCTL

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 SET_BAND_CONFIG IOCTL, making
sure user task has right permission to process the command.

Change-Id: Ie8a36bfa07a7b21601364b27b3c4bc888a6a5b4e
CRs-Fixed: 930952
Mukul Sharma il y a 9 ans
Parent
commit
a5fe19828c
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      core/hdd/src/wlan_hdd_wext.c

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

@@ -9362,6 +9362,12 @@ static int __iw_set_band_config(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;
+	}
+
 	return hdd_set_band(dev, value[0]);
 }