From 418c398e20bddb649fe1e844ddea4c781753f70a Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Fri, 15 Apr 2016 12:57:05 -0700 Subject: net: wireless: bcmdhd: check privilege on priv cmd check net admin capability for ioctl calls BUG=26425765 Change-Id: Idae75c9fc530add3ead3508d25e994bbfec9a6de --- drivers/net/wireless/bcmdhd/wl_android.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c index 742d873..e345183 100644 --- a/drivers/net/wireless/bcmdhd/wl_android.c +++ b/drivers/net/wireless/bcmdhd/wl_android.c @@ -843,6 +843,10 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) ret = -EINVAL; goto exit; } + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + goto exit; + } if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) { ret = -EFAULT; goto exit; -- cgit v1.1