]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/tun.c
tun: Check supplemental groups in TUN/TAP driver.
[karo-tx-linux.git] / drivers / net / tun.c
index 457f2d7430cf13684f6ac4c5c971530d029d8b46..15d67635bb10540ee1185818aaa2b83c86bbee5b 100644 (file)
@@ -123,7 +123,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
 
        /* Check permissions */
        if (((tun->owner != -1 && cred->euid != tun->owner) ||
-            (tun->group != -1 && cred->egid != tun->group)) &&
+            (tun->group != -1 && !in_egroup_p(tun->group))) &&
                !capable(CAP_NET_ADMIN))
                return -EPERM;