DivestOS/Patches/Linux_CVEs/CVE-2015-0571/qcacld-2.0/0005.patch
2017-11-07 18:55:10 -05:00

38 lines
1.3 KiB
Diff

From 0858d21caf17d56f8d2353590c1ec245073222e0 Mon Sep 17 00:00:00 2001
From: Mukul Sharma <mukul@qti.qualcomm.com>
Date: Tue, 27 Oct 2015 23:37:46 +0530
Subject: wlan:Check priviledge permission for SET_VAR_INTS_GETNONE 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_VAR_INTS_GETNONE, making
sure user task has right permission to process the command.
Change-Id: Icbdfe69c18c1ab3b75d63e046d5251307a794817
CRs-Fixed: 930942
---
CORE/HDD/src/wlan_hdd_wext.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 67ed8a3..27c1813 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -8916,6 +8916,11 @@ static int iw_hdd_set_var_ints_getnone(struct net_device *dev,
int apps_args[MAX_VAR_ARGS] = {0};
int ret, num_args;
+ 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(&u_priv_wrqu.data, wrqu))
return -EINVAL;
--
cgit v1.1