From aaeeed43f9597631982835481c7cf2621f6455f0 Mon Sep 17 00:00:00 2001 From: Hanumantha Reddy Pothula Date: Wed, 28 Oct 2015 00:23:45 +0530 Subject: wlan:Check priviledge permission for SET_THREE_INT_GET_NONE 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_THREE_INT_GET_NONE IOCTL, making sure user task has right permission to process the command. Change-Id: I3c695160d637ed87b04ccf3299985055a9791c4b CRs-Fixed: 930948 --- CORE/HDD/src/wlan_hdd_wext.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index c1ba718..28a280b 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -7959,6 +7959,12 @@ static int __iw_set_three_ints_getnone(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; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) return ret; -- cgit v1.1