Skip to content

Commit e10337d

Browse files
thejhmicah-morton
authored andcommitted
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>
1 parent 4f72123 commit e10337d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎security/safesetid/lsm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int safesetid_security_capable(const struct cred *cred,
9090
*/
9191
pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n",
9292
__kuid_val(cred->uid));
93-
return -1;
93+
return -EPERM;
9494
}
9595

9696
/*

0 commit comments

Comments
 (0)