projects
/
platform
/
kernel
/
kernel-mfld-blackbay.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7e1524
)
net: Only NET_ADMIN is allowed to fully control TUN interfaces.
author
Chia-chi Yeh
<chiachi@android.com>
Fri, 15 Jul 2011 22:32:57 +0000
(15:32 -0700)
committer
mgross
<mark.gross@intel.com>
Wed, 9 Nov 2011 20:19:30 +0000
(12:19 -0800)
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
drivers/net/tun.c
patch
|
blob
|
history
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index
fb50e5a
..
76b8650
100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-1239,6
+1239,12
@@
static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
int vnet_hdr_sz;
int ret;
+#ifdef CONFIG_ANDROID_PARANOID_NETWORK
+ if (cmd != TUNGETIFF && !capable(CAP_NET_ADMIN)) {
+ return -EPERM;
+ }
+#endif
+
if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89)
if (copy_from_user(&ifr, argp, ifreq_len))
return -EFAULT;