linux/security/integrity
Mimi Zohar cc293c8466 ima: define an init_module critical data record
The init_module syscall loads an ELF image into kernel space without
measuring the buffer containing the ELF image.  To close this kernel
module integrity gap, define a new critical-data record which includes
the hash of the ELF image.

Instead of including the buffer data in the IMA measurement list,
include the hash of the buffer data to avoid large IMA measurement
list records.  The buffer data hash would be the same value as the
finit_module syscall file hash.

To enable measuring the init_module buffer and other critical data from
boot, define "ima_policy=critical_data" on the boot command line.  Since
builtin policies are not persistent, a custom IMA policy must include
the rule as well: measure func=CRITICAL_DATA label=modules

To verify the template data hash value, first convert the buffer data
hash to binary:
grep "init_module" \
	/sys/kernel/security/integrity/ima/ascii_runtime_measurements | \
	tail -1 | cut -d' ' -f 6 | xxd -r -p | sha256sum

Reported-by: Ken Goldman <kgold@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2024-04-08 07:55:48 -04:00
..
evm evm: Make it independent from 'integrity' LSM 2024-02-15 23:43:47 -05:00
ima ima: define an init_module critical data record 2024-04-08 07:55:48 -04:00
platform_certs
digsig.c integrity: eliminate unnecessary "Problem loading X.509 certificate" msg 2024-02-16 08:04:17 -05:00
digsig_asymmetric.c integrity: Move integrity_kernel_module_request() to IMA 2024-02-15 23:43:45 -05:00
iint.c integrity: Remove LSM 2024-02-15 23:43:48 -05:00
integrity.h integrity: Remove LSM 2024-02-15 23:43:48 -05:00
integrity_audit.c
Kconfig
Makefile ima: Move to LSM infrastructure 2024-02-15 23:43:46 -05:00