Skip to contentSkip to conversation

ppp: allow usage in namespaces

RFC New Matteo Croce 1 participant 1 message Oct 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 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.

---
 drivers/net/ppp/ppp_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ppp/ppp_generic.c +1 -1
index a404552555d4..be5634b4835b 100644
@@ -389,7 +389,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;
 }
Signature · 1 line
2.13.6