Skip to content
Commit 6beea7af authored by Florent Revest's avatar Florent Revest Committed by Mimi Zohar
Browse files

ima: add the ability to query the cached hash of a given file



This allows other parts of the kernel (perhaps a stacked LSM allowing
system monitoring, eg. the proposed KRSI LSM [1]) to retrieve the hash
of a given file from IMA if it's present in the iint cache.

It's true that the existence of the hash means that it's also in the
audit logs or in /sys/kernel/security/ima/ascii_runtime_measurements,
but it can be difficult to pull that information out for every
subsequent exec. This is especially true if a given host has been up
for a long time and the file was first measured a long time ago.

It should be kept in mind that this function gives access to cached
entries which can be removed, for instance on security_inode_free().

This is based on Peter Moody's patch:
 https://sourceforge.net/p/linux-ima/mailman/message/33036180/

[1] https://lkml.org/lkml/2019/9/10/393

Signed-off-by: default avatarFlorent Revest <revest@google.com>
Reviewed-by: default avatarKP Singh <kpsingh@chromium.org>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 5350ceb0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment