From 2cce8a8a36080907d9dd9d7d2f92934a25fbbd23 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 14 Apr 2016 15:10:41 -0700 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_wext.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index d7152da246b7..af8c3c5af3d0 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/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;