From: Jann Horn Date: Wed, 10 Apr 2019 16:56:27 +0000 (-0700) Subject: LSM: SafeSetID: fix use of literal -1 in capable hook X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e10337daefecb47209fd2af5f4fab0d1a370737f;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Micah Morton --- 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; } /*