mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
From 27d3007a7635ccca7ae9bfb98c89724652dcbc3b Mon Sep 17 00:00:00 2001
|
|
From: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
|
|
Date: Wed, 28 Oct 2015 21:05:26 -0700
|
|
Subject: wlan:Check priviledge permission for QCSAP_IOCTL_SETWPSIE
|
|
|
|
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 QCSAP_IOCTL_SETWPSIE IOCTL,
|
|
making sure user task has right permission to process the command.
|
|
|
|
CRs-Fixed: 930944
|
|
Git-commit: 2905578424256be07e6b9d8c63bb83d40cc52a71
|
|
Bug: 25344453
|
|
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
|
|
---
|
|
drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c | 6 ++++++
|
|
1 file changed, 6 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 51ee547..77b4124 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
|
|
@@ -3884,6 +3884,12 @@ static int iw_softap_setwpsie(struct net_device *dev,
|
|
|
|
ENTER();
|
|
|
|
+ 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
|
|
|