[PATCH v3 21/25] ima: Move to LSM infrastructure

Stefan Berger stefanb at linux.ibm.com
Tue Sep 5 19:17:09 UTC 2023


On 9/4/23 09:40, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu at huawei.com>
>
> Remove hardcoded IMA function calls (not for appraisal) from the LSM
> infrastructure, the VFS, NFS and the key subsystem.
>
> Make those functions as static (except for ima_file_check() which is
> exported, and ima_post_key_create_or_update(), which is not in ima_main.c),
> and register them as implementation of the respective hooks in the new
> function init_ima_lsm().
>
> Call init_ima_lsm() from integrity_lsm_init() (renamed from
> integrity_iintcache_init()), to make sure that the integrity subsystem is
> ready at the time IMA hooks are registered. The same will be done for EVM,
> by calling init_evm_lsm() just after init_ima_lsm().
>
> Signed-off-by: Roberto Sassu <roberto.sassu at huawei.com>
> Acked-by: Chuck Lever <chuck.lever at oracle.com>
> Reviewed-by: Casey Schaufler <casey at schaufler-ca.com>

> index 6e4d060ff378..58591b5cbdb4 100644
> --- a/include/linux/ima.h
> +++ b/include/linux/ima.h
> @@ -16,26 +16,7 @@ struct linux_binprm;
>   
>   #ifdef CONFIG_IMA
>   extern enum hash_algo ima_get_current_hash_algo(void);
> -extern int ima_bprm_check(struct linux_binprm *bprm);
>   extern int ima_file_check(struct file *file, int mask);

 From what I saw ima_file_check doesn't need to be public anymore, either.

    Stefan




More information about the Linux-security-module-archive mailing list