mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
From f66afdc6840e7647a965487194873826de57e655 Mon Sep 17 00:00:00 2001
|
|
From: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
|
|
Date: Sun, 1 Nov 2015 23:04:42 -0800
|
|
Subject: wlan:Check priviledge permission for SET_CHANNEL_RANGE
|
|
|
|
prima to qcacld-2.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_CHANNEL_RANGE IOCTL,
|
|
making sure user task has right permission to process the command.
|
|
|
|
CRs-Fixed: 930555
|
|
Git-commit: bcb1abfd803c6bb98bad35228d7c4f85b754836d
|
|
Git-repo: https://www.codeaurora.org/cgit/quic/la/platform/vendor/qcom-opensource/wlan/prima/
|
|
Bug: 25344453
|
|
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
|
|
---
|
|
drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
|
|
index b95a853..e534763 100644
|
|
--- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
|
|
+++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
|
|
@@ -3339,6 +3339,13 @@ static int iw_softap_set_channel_range(struct net_device *dev,
|
|
VOS_STATUS status;
|
|
int ret = 0; /* success */
|
|
|
|
+ if (!capable(CAP_NET_ADMIN))
|
|
+ {
|
|
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
|
|
+ FL("permission check failed"));
|
|
+ return -EPERM;
|
|
+ }
|
|
+
|
|
status = WLANSAP_SetChannelRange(hHal,startChannel,endChannel,band);
|
|
if(status != VOS_STATUS_SUCCESS)
|
|
{
|
|
--
|
|
cgit v1.1
|
|
|