summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJann Horn <jannh@google.com>2019-04-10 09:56:27 -0700
committerMicah Morton <mortonm@chromium.org>2019-07-15 08:08:03 -0700
commite10337daefecb47209fd2af5f4fab0d1a370737f (patch)
tree053b449a2b7d2c895083cc264e437f2442e43b0f /security
parent4f72123da579655855301b591535a1415224f123 (diff)
downloadlinux-e10337daefecb47209fd2af5f4fab0d1a370737f.tar.gz
LSM: SafeSetID: fix use of literal -1 in capable hook
The capable() hook returns an error number. -EPERM is actually the same as -1, so this doesn't make a difference in behavior. Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Micah Morton <mortonm@chromium.org>
Diffstat (limited to 'security')
-rw-r--r--security/safesetid/lsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/safesetid/lsm.c b/security/safesetid/lsm.c
index 22964e2a6187..7760019ad35d 100644
--- a/security/safesetid/lsm.c
+++ b/security/safesetid/lsm.c
@@ -90,7 +90,7 @@ static int safesetid_security_capable(const struct cred *cred,
*/
pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n",
__kuid_val(cred->uid));
- return -1;
+ return -EPERM;
}
/*