Skip to content

Commit

Permalink
wlan:Check priviledge permission
Browse files Browse the repository at this point in the history
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.

Bug: 27104184
Change-Id: Ia2465433aab6366160a167a62ca03e0ba720bcdb
Signed-off-by: Yuan Lin <yualin@google.com>
  • Loading branch information
Mukul Sharma authored and mdmower committed Oct 22, 2017
1 parent 31e59c1 commit 5d3fbdf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -7295,6 +7295,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
int ret = 0;

ENTER();

if (!capable(CAP_NET_ADMIN))
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
FL("permission check failed"));
return -EPERM;
}

if (extra == NULL)
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Expand Down

0 comments on commit 5d3fbdf

Please sign in to comment.