mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
|
From 518fd80981eefa9715e0851260b2c7aeb86551d7 Mon Sep 17 00:00:00 2001
|
||
|
From: Mukul Sharma <mukul@qti.qualcomm.com>
|
||
|
Date: Thu, 17 Mar 2016 10:34:06 -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.
|
||
|
|
||
|
Bug: 27104184
|
||
|
Change-Id: I66acff95d6151b32f1cb3c36a164e1de021e1e30
|
||
|
Signed-off-by: Yuan Lin <yualin@google.com>
|
||
|
---
|
||
|
drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c | 7 +++++++
|
||
|
1 file changed, 7 insertions(+)
|
||
|
|
||
|
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c
|
||
|
index 45c6f78..7598b99 100644
|
||
|
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c
|
||
|
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c
|
||
|
@@ -2147,6 +2147,13 @@ static int iw_softap_setwpsie(struct net_device *dev,
|
||
|
u_int16_t length;
|
||
|
ENTER();
|
||
|
|
||
|
+ if (!capable(CAP_NET_ADMIN))
|
||
|
+ {
|
||
|
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
|
||
|
+ FL("permission check failed"));
|
||
|
+ return -EPERM;
|
||
|
+ }
|
||
|
+
|
||
|
if(!wrqu->data.length)
|
||
|
return 0;
|
||
|
|
||
|
--
|
||
|
cgit v1.1
|
||
|
|