aboutsummaryrefslogtreecommitdiffstats
path: root/security/commoncap.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/commoncap.c')
-rw-r--r--security/commoncap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index f2399d8afbe0..dbd465a59286 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -77,8 +77,7 @@ int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
77{ 77{
78 for (;;) { 78 for (;;) {
79 /* The owner of the user namespace has all caps. */ 79 /* The owner of the user namespace has all caps. */
80 if (targ_ns != &init_user_ns && uid_eq(targ_ns->owner, 80 if (targ_ns != &init_user_ns && uid_eq(targ_ns->owner, cred->euid))
81 make_kuid(cred->user_ns, cred->euid)))
82 return 0; 81 return 0;
83 82
84 /* Do we have the necessary capabilities? */ 83 /* Do we have the necessary capabilities? */