From 9fd4483e08349eb1570c42da8acbac33e70a6e02 Mon Sep 17 00:00:00 2001 From: Amarnath Hullur Subramanyam Date: Wed, 28 Oct 2015 21:23:09 -0700 Subject: wlan:Check priviledge permission for SET_VAR_INTS_GETNONE IOCTL 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_VAR_INTS_GETNONE, making sure user task has right permission to process the command. CRs-Fixed: 930942 Git-commit: 0858d21caf17d56f8d2353590c1ec245073222e0 Bug: 25344453 Signed-off-by: Amarnath Hullur Subramanyam --- drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c index 51b52f3..ba9d0ff 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c @@ -7520,6 +7520,11 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, int staId = 0; struct iw_point s_priv_data; + if (!capable(CAP_NET_ADMIN)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } /* helper function to get iwreq_data with compat handling. */ if (hdd_priv_get_data(&s_priv_data, wrqu)) { return -EINVAL; -- cgit v1.1