-
- Downloads
LSM: Add "contents" flag to kernel_read_file hook
As with the kernel_load_data LSM hook, add a "contents" flag to the kernel_read_file LSM hook that indicates whether the LSM can expect a matching call to the kernel_post_read_file LSM hook with the full contents of the file. With the coming addition of partial file read support for kernel_read_file*() API, the LSM will no longer be able to always see the entire contents of a file during the read calls. For cases where the LSM must read examine the complete file contents, it will need to do so on its own every time the kernel_read_file hook is called with contents=false (or reject such cases). Adjust all existing LSMs to retain existing behavior. Signed-off-by:Kees Cook <keescook@chromium.org> Reviewed-by:
Mimi Zohar <zohar@linux.ibm.com> Link: https://lore.kernel.org/r/20201002173828.2099543-12-keescook@chromium.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
- fs/kernel_read_file.c 1 addition, 1 deletionfs/kernel_read_file.c
- include/linux/ima.h 4 additions, 2 deletionsinclude/linux/ima.h
- include/linux/lsm_hook_defs.h 1 addition, 1 deletioninclude/linux/lsm_hook_defs.h
- include/linux/lsm_hooks.h 3 additions, 0 deletionsinclude/linux/lsm_hooks.h
- include/linux/security.h 4 additions, 2 deletionsinclude/linux/security.h
- security/integrity/ima/ima_main.c 9 additions, 1 deletionsecurity/integrity/ima/ima_main.c
- security/loadpin/loadpin.c 12 additions, 2 deletionssecurity/loadpin/loadpin.c
- security/security.c 4 additions, 3 deletionssecurity/security.c
- security/selinux/hooks.c 3 additions, 2 deletionssecurity/selinux/hooks.c
Loading
Please register or sign in to comment