summaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp
diff options
context:
space:
mode:
authorMatteo Croce <mcroce@redhat.com>2017-10-27 20:08:23 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-29 03:55:32 +0100
commit90e229ef61fad240554f5899eb122fbe44990f78 (patch)
tree4a8b72b837553c2b3658f147a65a50d13a51267a /drivers/net/ppp
parentMerge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher... (diff)
downloadlinux-90e229ef61fad240554f5899eb122fbe44990f78.tar.xz
linux-90e229ef61fad240554f5899eb122fbe44990f78.zip
ppp: allow usage in namespaces
Check for CAP_NET_ADMIN with ns_capable() instead of capable() to allow usage of ppp in user namespace other than the init one. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r--drivers/net/ppp/ppp_generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 6566107cef84..af7f93ed1487 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -390,7 +390,7 @@ static int ppp_open(struct inode *inode, struct file *file)
/*
* This could (should?) be enforced by the permissions on /dev/ppp.
*/
- if (!capable(CAP_NET_ADMIN))
+ if (!ns_capable(file->f_cred->user_ns, CAP_NET_ADMIN))
return -EPERM;
return 0;
}