aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 457f2d7430c..15d67635bb1 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -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;