summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJann Horn <jannh@google.com>2019-04-10 18:56:27 +0200
committerMicah Morton <mortonm@chromium.org>2019-07-15 17:08:03 +0200
commite10337daefecb47209fd2af5f4fab0d1a370737f (patch)
tree053b449a2b7d2c895083cc264e437f2442e43b0f
parentLSM: SafeSetID: verify transitive constrainedness (diff)
downloadlinux-e10337daefecb47209fd2af5f4fab0d1a370737f.tar.xz
linux-e10337daefecb47209fd2af5f4fab0d1a370737f.zip
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>
-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;
}
/*