]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lsm: Refactor return value of LSM hook vm_enough_memory
authorXu Kuohai <xukuohai@huawei.com>
Wed, 24 Jul 2024 02:06:58 +0000 (10:06 +0800)
committerPaul Moore <paul@paul-moore.com>
Wed, 31 Jul 2024 18:46:51 +0000 (14:46 -0400)
commitbe72a57527fde6c80061c5f9d0e28762eb817b03
treeabefde6ce06f167ce75f8f3802fc227934cdb9c8
parent61a1dcdceb44d79e5ab511295791b88ea178c045
lsm: Refactor return value of LSM hook vm_enough_memory

To be consistent with most LSM hooks, convert the return value of
hook vm_enough_memory to 0 or a negative error code.

Before:
- Hook vm_enough_memory returns 1 if permission is granted, 0 if not.
- LSM_RET_DEFAULT(vm_enough_memory_mm) is 1.

After:
- Hook vm_enough_memory reutrns 0 if permission is granted, negative
  error code if not.
- LSM_RET_DEFAULT(vm_enough_memory_mm) is 0.

Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/lsm_hook_defs.h
include/linux/security.h
security/commoncap.c
security/security.c
security/selinux/hooks.c