Jelajahi Sumber

qcacld-3.0: Check priviledge permission for SET_THREE_INT_GET_NONE

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

Change-Id: I3c695160d637ed87b04ccf3299985055a9791c4b
CRs-Fixed: 930948
Rajeev Kumar 9 tahun lalu
induk
melakukan
2cce8a8a36
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      core/hdd/src/wlan_hdd_wext.c

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

@@ -7021,6 +7021,11 @@ static int __iw_set_three_ints_getnone(struct net_device *dev,
 
 	ENTER_DEV(dev);
 
+	if (!capable(CAP_NET_ADMIN)) {
+		hddLog(LOGE, FL("permission check failed"));
+		return -EPERM;
+	}
+
 	ret = wlan_hdd_validate_context(hdd_ctx);
 	if (0 != ret)
 		return ret;