lsm: fix default return value for vm_enough_memory
authorOndrej Mosnacek <omosnace@redhat.com>
Tue, 31 Oct 2023 12:32:06 +0000 (13:32 +0100)
committerPaul Moore <paul@paul-moore.com>
Wed, 8 Nov 2023 20:39:42 +0000 (15:39 -0500)
1 is the return value that implements a "no-op" hook, not 0.

Cc: stable@vger.kernel.org
Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/lsm_hook_defs.h

index 99b8176c3738d12a21b601789c5cac2e9bfd7893..4dd55fdfec2675a8a7f66e2a3ba1585ca1c5d281 100644 (file)
@@ -48,7 +48,7 @@ LSM_HOOK(int, 0, quota_on, struct dentry *dentry)
 LSM_HOOK(int, 0, syslog, int type)
 LSM_HOOK(int, 0, settime, const struct timespec64 *ts,
         const struct timezone *tz)
-LSM_HOOK(int, 0, vm_enough_memory, struct mm_struct *mm, long pages)
+LSM_HOOK(int, 1, vm_enough_memory, struct mm_struct *mm, long pages)
 LSM_HOOK(int, 0, bprm_creds_for_exec, struct linux_binprm *bprm)
 LSM_HOOK(int, 0, bprm_creds_from_file, struct linux_binprm *bprm, const struct file *file)
 LSM_HOOK(int, 0, bprm_check_security, struct linux_binprm *bprm)