ima: Move to LSM infrastructure
Move hardcoded IMA function calls (not appraisal-specific functions) from various places in the kernel to the LSM infrastructure, by introducing a new LSM named 'ima' (at the end of the LSM list and always enabled like 'integrity'). Having IMA before EVM in the Makefile is sufficient to preserve the relative order of the new 'ima' LSM in respect to the upcoming 'evm' LSM, and thus the order of IMA and EVM function calls as when they were hardcoded. Make moved functions as static (except 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(). Select CONFIG_SECURITY_PATH, to ensure that the path-based LSM hook path_post_mknod is always available and ima_post_path_mknod() is always executed to mark files as new, as before the move. A slight difference is that IMA and EVM functions registered for the inode_post_setattr, inode_post_removexattr, path_post_mknod, inode_post_cr...
Showing
- fs/file_table.c 0 additions, 2 deletionsfs/file_table.c
- fs/namei.c 0 additions, 6 deletionsfs/namei.c
- fs/nfsd/vfs.c 0 additions, 7 deletionsfs/nfsd/vfs.c
- fs/open.c 0 additions, 1 deletionfs/open.c
- include/linux/ima.h 0 additions, 104 deletionsinclude/linux/ima.h
- include/uapi/linux/lsm.h 1 addition, 0 deletionsinclude/uapi/linux/lsm.h
- security/integrity/Makefile 1 addition, 0 deletionssecurity/integrity/Makefile
- security/integrity/ima/Kconfig 1 addition, 0 deletionssecurity/integrity/ima/Kconfig
- security/integrity/ima/ima.h 6 additions, 0 deletionssecurity/integrity/ima/ima.h
- security/integrity/ima/ima_main.c 57 additions, 21 deletionssecurity/integrity/ima/ima_main.c
- security/integrity/integrity.h 1 addition, 0 deletionssecurity/integrity/integrity.h
- security/keys/key.c 1 addition, 8 deletionssecurity/keys/key.c
- security/security.c 12 additions, 51 deletionssecurity/security.c
- tools/testing/selftests/lsm/lsm_list_modules_test.c 3 additions, 0 deletionstools/testing/selftests/lsm/lsm_list_modules_test.c
Please register or sign in to comment