Re: [PATCH bpf-next v3 1/3] ima: Implement ima_inode_hash

From: Mimi Zohar
Date: Wed Nov 25 2020 - 07:28:37 EST


On Tue, 2020-11-24 at 15:12 +0000, KP Singh wrote:
> From: KP Singh <kpsingh@xxxxxxxxxx>
>
> This is in preparation to add a helper for BPF LSM programs to use
> IMA hashes when attached to LSM hooks. There are LSM hooks like
> inode_unlink which do not have a struct file * argument and cannot
> use the existing ima_file_hash API.
>
> An inode based API is, therefore, useful in LSM based detections like an
> executable trying to delete itself which rely on the inode_unlink LSM
> hook.
>
> Moreover, the ima_file_hash function does nothing with the struct file
> pointer apart from calling file_inode on it and converting it to an
> inode.
>
> Signed-off-by: KP Singh <kpsingh@xxxxxxxxxx>


Acked-by: Mimi Zohar <zohar@xxxxxxxxxxxxx>