From 711b9fa5125d29dbd23ad68cc78c302b8e12c42e Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Mon, 2 Nov 2015 19:28:14 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_wext.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 91076fe511b3..d20cf03b7df5 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/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]); }