Re: [PATCH v16 15/20] security: add security_inode_setintegrity() hook

Paul Moore
2024-04-02T01:26:47Z

On Mar 28, 2024 Fan Wu <wufan@linux.microsoft.com> wrote:
>
> This patch introduces a new hook to save inode's integrity
> data. For example, for fsverity enabled files, LSMs can use this hook to
> save the verified fsverity builtin signature into the inode's security
> blob, and LSMs can make access decisions based on the data inside
> the signature, like the signer certificate.
>
> Signed-off-by: Fan Wu <wufan@linux.microsoft.com>
>
> --
> v1-v14:
> + Not present
>
> v15:
> + Introduced
>
> v16:
> + Switch to call_int_hook()
>
> ---
> include/linux/lsm_hook_defs.h | 2 ++
> include/linux/security.h | 10 ++++++++++
> security/security.c | 20 ++++++++++++++++++++
> 3 files changed, 32 insertions(+)
>
> diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
> index b391a7f13053..6f746dfdb28b 100644
> --- a/include/linux/lsm_hook_defs.h
> +++ b/include/linux/lsm_hook_defs.h
> @@ -1020,6 +1023,13 @@ static inline int security_inode_copy_up(struct dentry *src, struct cred **new)
> return 0;
> }
>
> +static inline int security_inode_setintegrity(struct inode *inode,
> + enum lsm_integrity_type, type,

Another bonus comma ...

> + const void *value, size_t size)
> +{
> + return 0;
> +}
> +

--
paul-moore.com