mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
ANDROID: net: paranoid: Only NET_ADMIN is allowed to fully control TUN interfaces.
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
This commit is contained in:
parent
d846068e98
commit
eaacc57b23
@ -2252,6 +2252,12 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
|
||||
int le;
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
|
||||
if (cmd != TUNGETIFF && !capable(CAP_NET_ADMIN)) {
|
||||
return -EPERM;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cmd == TUNSETIFF || cmd == TUNSETQUEUE || _IOC_TYPE(cmd) == SOCK_IOC_TYPE) {
|
||||
if (copy_from_user(&ifr, argp, ifreq_len))
|
||||
return -EFAULT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user