evm: Store and detect metadata inode attributes changes
authorStefan Berger <stefanb@linux.ibm.com>
Fri, 23 Feb 2024 17:25:09 +0000 (12:25 -0500)
committerMimi Zohar <zohar@linux.ibm.com>
Tue, 9 Apr 2024 21:14:57 +0000 (17:14 -0400)
commita652aa59068bd78d96a1ab6ea7c0c4d3c79fb5e8
tree46c5b38246b8c5fabd7f5f6b1d7f535ad78db104
parent309e2b775da8b2c28fccc4ac2621801f06920ce0
evm: Store and detect metadata inode attributes changes

On stacked filesystem the metadata inode may be different than the one
file data inode and therefore changes to it need to be detected
independently. Therefore, store the i_version, device number, and inode
number associated with the file metadata inode.

Implement a function to detect changes to the inode and if a change is
detected reset the evm_status. This function will be called by IMA when
IMA detects that the metadata inode is different from the file's inode.

Co-developed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
include/linux/evm.h
security/integrity/evm/evm.h
security/integrity/evm/evm_crypto.c
security/integrity/evm/evm_main.c