aboutsummaryrefslogtreecommitdiff
path: root/security/lsm_syscalls.c
diff options
context:
space:
mode:
authorGravatar Casey Schaufler <casey@schaufler-ca.com> 2024-03-14 11:31:26 -0400
committerGravatar Paul Moore <paul@paul-moore.com> 2024-03-14 11:31:26 -0400
commita5a858f622a0aff5cdb5e271442cd01b2a01467f (patch)
tree4364a8a25bce17a4d0ec28a79445f2ff62824d1e /security/lsm_syscalls.c
parentMerge tag 'printk-for-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/p... (diff)
downloadlinux-a5a858f622a0aff5cdb5e271442cd01b2a01467f.tar.gz
linux-a5a858f622a0aff5cdb5e271442cd01b2a01467f.tar.bz2
linux-a5a858f622a0aff5cdb5e271442cd01b2a01467f.zip
lsm: use 32-bit compatible data types in LSM syscalls
Change the size parameters in lsm_list_modules(), lsm_set_self_attr() and lsm_get_self_attr() from size_t to u32. This avoids the need to have different interfaces for 32 and 64 bit systems. Cc: stable@vger.kernel.org Fixes: a04a1198088a ("LSM: syscalls for current process attributes") Fixes: ad4aff9ec25f ("LSM: Create lsm_list_modules system call") Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Reported-and-reviewed-by: Dmitry V. Levin <ldv@strace.io> [PM: subject and metadata tweaks, syscall.h fixes] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/lsm_syscalls.c')
-rw-r--r--security/lsm_syscalls.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/lsm_syscalls.c b/security/lsm_syscalls.c
index 5d391b1f7e69..8440948a690c 100644
--- a/security/lsm_syscalls.c
+++ b/security/lsm_syscalls.c
@@ -53,7 +53,7 @@ u64 lsm_name_to_attr(const char *name)
* value indicating the reason for the error is returned.
*/
SYSCALL_DEFINE4(lsm_set_self_attr, unsigned int, attr, struct lsm_ctx __user *,
- ctx, size_t, size, u32, flags)
+ ctx, u32, size, u32, flags)
{
return security_setselfattr(attr, ctx, size, flags);
}
@@ -75,7 +75,7 @@ SYSCALL_DEFINE4(lsm_set_self_attr, unsigned int, attr, struct lsm_ctx __user *,
* a negative value indicating the error is returned.
*/
SYSCALL_DEFINE4(lsm_get_self_attr, unsigned int, attr, struct lsm_ctx __user *,
- ctx, size_t __user *, size, u32, flags)
+ ctx, u32 __user *, size, u32, flags)
{
return security_getselfattr(attr, ctx, size, flags);
}
@@ -93,11 +93,11 @@ SYSCALL_DEFINE4(lsm_get_self_attr, unsigned int, attr, struct lsm_ctx __user *,
* required size. In all other cases a negative value indicating the
* error is returned.
*/
-SYSCALL_DEFINE3(lsm_list_modules, u64 __user *, ids, size_t __user *, size,
+SYSCALL_DEFINE3(lsm_list_modules, u64 __user *, ids, u32 __user *, size,
u32, flags)
{
- size_t total_size = lsm_active_cnt * sizeof(*ids);
- size_t usize;
+ u32 total_size = lsm_active_cnt * sizeof(*ids);
+ u32 usize;
int i;
if (flags)