From: Matteo Croce Date: Fri, 27 Oct 2017 18:08:23 +0000 (+0200) Subject: ppp: allow usage in namespaces X-Git-Tag: v4.15-rc1~84^2~249 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=90e229ef61fad240554f5899eb122fbe44990f78;p=linux.git 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 Signed-off-by: David S. Miller --- 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; }