aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/keys/persistent.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/keys/persistent.c b/security/keys/persistent.c
index 82f4957a7acf..0ad3ee283781 100644
--- a/security/keys/persistent.c
+++ b/security/keys/persistent.c
@@ -144,10 +144,8 @@ long keyctl_get_persistent(uid_t _uid, key_serial_t destid)
144 /* You can only see your own persistent cache if you're not 144 /* You can only see your own persistent cache if you're not
145 * sufficiently privileged. 145 * sufficiently privileged.
146 */ 146 */
147 if (uid_eq(uid, current_uid()) && 147 if (!uid_eq(uid, current_uid()) &&
148 uid_eq(uid, current_suid()) && 148 !uid_eq(uid, current_euid()) &&
149 uid_eq(uid, current_euid()) &&
150 uid_eq(uid, current_fsuid()) &&
151 !ns_capable(ns, CAP_SETUID)) 149 !ns_capable(ns, CAP_SETUID))
152 return -EPERM; 150 return -EPERM;
153 } 151 }