DivestOS/Patches/Linux_CVEs/CVE-2016-0806/qcacld-2.0/0023.patch
2017-11-07 18:55:10 -05:00

41 lines
1.7 KiB
Diff

From 967f88782e93809cfb27a60b82a3a069d2a52fc4 Mon Sep 17 00:00:00 2001
From: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
Date: Wed, 28 Oct 2015 21:12:55 -0700
Subject: wlan:Check priviledge permission for CLEAR_MCBC_FILTER 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 CLEAR_MCBC_FILTER IOCTL, making
sure user task has right permission to process the command.
CRs-Fixed: 930954
Git-commit: 9eeafd788f53cc37c169b299f91ca9c558b228f9
Bug: 25344453
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
---
drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
index 841ed4c..fc8c917 100644
--- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
+++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
@@ -8143,6 +8143,12 @@ static int iw_clear_dynamic_mcbc_filter(struct net_device *dev,
tpSirWlanSetRxpFilters wlanRxpFilterParam;
hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s: ", __func__);
+ if (!capable(CAP_NET_ADMIN)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("permission check failed"));
+ return -EPERM;
+ }
+
//Reset the filter to INI value as we have to clear the dynamic filter
pHddCtx->configuredMcastBcastFilter = pHddCtx->cfg_ini->mcastBcastFilterSetting;
--
cgit v1.1