[RFC][PATCH] ima: Add support for staging measurements for deletion

Gregory Lumen gregorylumen at linux.microsoft.com
Wed Dec 10 19:12:58 UTC 2025


Roberto,

The proposed approach appears to be workable. However, if our primary goal 
here is to enable UM to free kernel memory consumed by the IMA log with an 
absolute minimum of kernel functionality/change, then I would argue that 
the proposed Stage-then-delete approach still represents unnecessary 
complexity when compared to a trim-to-N solution. Specifically:

- Any functional benefit offered through the introduction of a staged 
measurement list could be equally achieved in UM with a trim-to-N solution 
coupled with the proposed ima_measure_users counter for access locking.

- There exists a potential UM measurement-loss race condition introduced 
by the staging functionality that would not exist with a trim-to-N 
approach. (Occurs if a kexec call occurs after a UM agent has staged 
measurements for deletion, but has not completed copying them to 
userspace). This could be avoided by persisting staged measurements across 
kexec calls at the cost of making the proposed change larger.

Thanks,
-Gregory Lumen




More information about the Linux-security-module-archive mailing list