From ede034fd604a9cdb20eb7accdaec4a8e70ffac41 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Thu, 17 Mar 2016 16:55:17 -0700 Subject: wlan:Check priviledge permission for SET_BAND_CONFIG 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_BAND_CONFIG IOCTL, making sure user task has right permission to process the command. Bug: 27104184 Change-Id: I34e9d91f778b09eb73881aed5c6e3a10cbbd208c Signed-off-by: Yuan Lin --- drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c index 1288bd0..7add243 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c @@ -6499,6 +6499,13 @@ static int iw_set_band_config(struct net_device *dev, tANI_U8 *ptr = (tANI_U8*)wrqu->data.pointer; int ret = 0; + if (!capable(CAP_NET_ADMIN)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("permission check failed")); + return -EPERM; + } + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,"%s: ", __func__); if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) -- cgit v1.1