Re: [PATCH v6 04/11] LSM: syscalls for current process attributes
From: Arnd Bergmann
Date: Fri Mar 03 2023 - 13:43:09 EST
On Wed, Feb 22, 2023, at 21:08, Casey Schaufler wrote:
> +/**
> + * sys_lsm_set_self_attr - Set current task's security module attribute
> + * @ctx: the LSM contexts
> + * @size: size of @ctx
> + * @flags: which attribute to set
> + *
> + * Sets the calling task's LSM context. On success this function
> + * returns 0. If the attribute specified cannot be set a negative
> + * value indicating the reason for the error is returned.
> + */
> +SYSCALL_DEFINE3(lsm_set_self_attr, struct lsm_ctx __user *, ctx,
> size_t __user,
> + size, u64, flags)
> +{
> + return security_setselfattr(flags, ctx, size);
> +}
> +
> +SYSCALL_DEFINE3(lsm_get_self_attr, struct lsm_ctx __user *, ctx,
> + size_t __user *, size, u64, flags)
> +{
> + return security_getselfattr(flags, ctx, size);
> +}
As with the other patch I commented on, I think it's better to use a
32-bit 'flags' argument here, to make this work for compat tasks.
Arnd