projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'linus' into cpumask-for-linus
[cascardo/linux.git]
/
security
/
keys
/
permission.c
diff --git
a/security/keys/permission.c
b/security/keys/permission.c
index
5d9fc7b
..
0ed802c
100644
(file)
--- a/
security/keys/permission.c
+++ b/
security/keys/permission.c
@@
-35,6
+35,9
@@
int key_task_permission(const key_ref_t key_ref, const struct cred *cred,
key = key_ref_to_ptr(key_ref);
key = key_ref_to_ptr(key_ref);
+ if (key->user->user_ns != cred->user->user_ns)
+ goto use_other_perms;
+
/* use the second 8-bits of permissions for keys the caller owns */
if (key->uid == cred->fsuid) {
kperm = key->perm >> 16;
/* use the second 8-bits of permissions for keys the caller owns */
if (key->uid == cred->fsuid) {
kperm = key->perm >> 16;
@@
-56,6
+59,8
@@
int key_task_permission(const key_ref_t key_ref, const struct cred *cred,
}
}
}
}
+use_other_perms:
+
/* otherwise use the least-significant 8-bits */
kperm = key->perm;
/* otherwise use the least-significant 8-bits */
kperm = key->perm;