]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tun.c
[NET]: Require CAP_NET_ADMIN to create tuntap devices.
[linux-2.6-omap-h63xx.git] / drivers / net / tun.c
index a1ed2d9837402a31f6f46d90b4ae4c49bbd3e485..6c62d5c882683f09267e06e9dade80f1cfb9482d 100644 (file)
@@ -490,6 +490,9 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
 
                err = -EINVAL;
 
+               if (!capable(CAP_NET_ADMIN))
+                       return -EPERM;
+
                /* Set dev type */
                if (ifr->ifr_flags & IFF_TUN) {
                        /* TUN device */