linux/security/integrity/ima
Roberto Sassu fcb0318a29 ima: Support staging and deleting N measurements records
Add support for sending a value N between 1 and ULONG_MAX to the IMA
original measurement interface. This value represents the number of
measurements that should be deleted from the current measurements list. In
this case, measurements are staged in an internal non-user visible list,
and immediately deleted.

This staging method allows the remote attestation agents to easily separate
the measurements that were verified (staged and deleted) from those that
weren't due to the race between taking a TPM quote and reading the
measurements list.

In order to minimize the locking time of ima_extend_list_mutex, deleting
N records is realized by doing a lockless walk in the current measurements
list to determine the N-th entry to cut, to cut the current measurements
list under the lock, and by deleting the excess records after releasing the
lock.

Flushing the hash table is not supported for N records, since it would
require removing the N records one by one from the hash table under the
ima_extend_list_mutex lock, which would increase the locking time.

Link: https://github.com/linux-integrity/linux/issues/1
Co-developed-by: Steven Chen <chenste@linux.microsoft.com>
Signed-off-by: Steven Chen <chenste@linux.microsoft.com>
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2026-06-08 11:43:34 -04:00
..
ima_api.c ima: Remove ima_h_table structure 2026-06-08 11:42:40 -04:00
ima_appraise.c ima: return error early if file xattr cannot be changed 2026-04-27 07:24:24 -04:00
ima_asymmetric_keys.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
ima_crypto.c ima: remove buggy support for asynchronous hashes 2026-03-17 18:53:49 -04:00
ima_efi.c ima: efi: Drop unnecessary check for CONFIG_MODULE_SIG/CONFIG_KEXEC_SIG 2026-03-08 08:26:08 -04:00
ima_fs.c ima: Support staging and deleting N measurements records 2026-06-08 11:43:34 -04:00
ima_iint.c lsm: add the inode_free_security_rcu() LSM implementation hook 2024-08-12 15:35:04 -04:00
ima_init.c ima: Replace static htable queue with dynamically allocated array 2026-06-08 11:42:49 -04:00
ima_kexec.c ima: Add support for staging measurements with prompt 2026-06-08 11:43:21 -04:00
ima_main.c ima: fallback to using i_version to detect file change 2026-03-08 08:24:52 -04:00
ima_modsig.c module: Give MODULE_SIG_STRING a more descriptive name 2026-03-24 21:42:37 +00:00
ima_mok.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ima_policy.c ima: Fix sigv3 signature handling for EVM_IMA_XATTR_DIGSIG 2026-04-27 07:24:07 -04:00
ima_queue_keys.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ima_queue.c ima: Support staging and deleting N measurements records 2026-06-08 11:43:34 -04:00
ima_template_lib.c ima: fix buffer overrun in ima_eventdigest_init_common 2024-10-09 22:49:24 -04:00
ima_template_lib.h ima: define a new template field named 'd-ngv2' and templates 2022-05-05 11:49:13 -04:00
ima_template.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ima.h ima: Support staging and deleting N measurements records 2026-06-08 11:43:34 -04:00
Kconfig ima: Support staging and deleting N measurements records 2026-06-08 11:43:34 -04:00
Makefile ima: Make it independent from 'integrity' LSM 2024-02-15 23:43:47 -05:00