浏览代码

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 9 年之前
父节点
当前提交
711b9fa512
共有 1 个文件被更改,包括 6 次插入0 次删除
  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]);
 }