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

40 lines
1.3 KiB
Diff

From 6feb2faf80a05940618aa2eef2b62e4e2e54f148 Mon Sep 17 00:00:00 2001
From: Mukul Sharma <mukul@qti.qualcomm.com>
Date: Tue, 27 Oct 2015 23:42:45 +0530
Subject: wlan:Check priviledge permission before processing SET_OEM_DATA_REQ
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_OEM_DATA_REQ IOCTLs, making
sure user task has right permission to process the command.
Change-Id: Ida0133304b00627d01ef7f85f5b15ed9d404d443
CRs-Fixed: 930549
---
CORE/HDD/src/wlan_hdd_oemdata.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c
index 17e3689..1aef257 100644
--- a/CORE/HDD/src/wlan_hdd_oemdata.c
+++ b/CORE/HDD/src/wlan_hdd_oemdata.c
@@ -200,6 +200,12 @@ static int __iw_set_oem_data_req(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;
+ }
+
if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
--
cgit v1.1