linux-xiaomi-chiron/security/integrity/ima
Tushar Sugandhi 91ccbbac17 dm ima: measure data on table load
DM configures a block device with various target specific attributes
passed to it as a table.  DM loads the table, and calls each target’s
respective constructors with the attributes as input parameters.
Some of these attributes are critical to ensure the device meets
certain security bar.  Thus, IMA should measure these attributes, to
ensure they are not tampered with, during the lifetime of the device.
So that the external services can have high confidence in the
configuration of the block-devices on a given system.

Some devices may have large tables.  And a given device may change its
state (table-load, suspend, resume, rename, remove, table-clear etc.)
many times.  Measuring these attributes each time when the device
changes its state will significantly increase the size of the IMA logs.
Further, once configured, these attributes are not expected to change
unless a new table is loaded, or a device is removed and recreated.
Therefore the clear-text of the attributes should only be measured
during table load, and the hash of the active/inactive table should be
measured for the remaining device state changes.

Export IMA function ima_measure_critical_data() to allow measurement
of DM device parameters, as well as target specific attributes, during
table load.  Compute the hash of the inactive table and store it for
measurements during future state change.  If a load is called multiple
times, update the inactive table hash with the hash of the latest
populated table.  So that the correct inactive table hash is measured
when the device transitions to different states like resume, remove,
rename, etc.

Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com> # leak fix
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-08-10 13:32:40 -04:00
..
ima.h powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c 2021-03-08 12:06:29 -07:00
ima_api.c idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
ima_appraise.c ima: differentiate between EVM failures in the audit log 2021-06-10 16:36:41 -04:00
ima_asymmetric_keys.c ima: Include header defining ima_post_key_create_or_update() 2021-06-08 16:29:10 -04:00
ima_crypto.c ima/evm: Fix type mismatch 2021-06-08 16:29:10 -04:00
ima_efi.c ima: generalize x86/EFI arch glue for other EFI architectures 2020-11-06 07:40:42 +01:00
ima_fs.c ima/evm: Fix type mismatch 2021-06-08 16:29:10 -04:00
ima_init.c evm: Load EVM key in ima_load_x509() to avoid appraisal 2021-05-21 12:47:04 -04:00
ima_kexec.c ima: Fix warning: no previous prototype for function 'ima_add_kexec_buffer' 2021-06-11 11:27:03 -04:00
ima_main.c dm ima: measure data on table load 2021-08-10 13:32:40 -04:00
ima_modsig.c ima: Move comprehensive rule validation checks out of the token parser 2020-07-20 13:28:15 -04:00
ima_mok.c certs: Fix blacklist flag type confusion 2021-01-21 16:16:10 +00:00
ima_policy.c ima: Fix fall-through warnings for Clang 2021-04-20 16:54:14 -04:00
ima_queue.c IMA: support for duplicate measurement records 2021-06-11 12:54:13 -04:00
ima_queue_keys.c idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
ima_template.c ima: Set correct casting types 2021-06-08 16:29:10 -04:00
ima_template_lib.c ima: Fix fall-through warning for Clang 2021-06-08 23:33:48 -04:00
ima_template_lib.h ima: Define new template fields xattrnames, xattrlengths and xattrvalues 2021-06-02 18:56:13 -04:00
Kconfig IMA: support for duplicate measurement records 2021-06-11 12:54:13 -04:00
Makefile ima: generalize x86/EFI arch glue for other EFI architectures 2020-11-06 07:40:42 +01:00