summaryrefslogtreecommitdiffstats
path: root/fs/attr.c
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@huawei.com>2024-02-15 11:31:09 +0100
committerPaul Moore <paul@paul-moore.com>2024-02-15 23:43:46 -0500
commit84594c9ecdca7ca595bc50e315093cb76921fd8e (patch)
tree12049a5093126a4bda4cd4965c31452b91b53728 /fs/attr.c
parentcd3cec0a02c7338ce2901c574f3935b8f6984aab (diff)
downloadlinux-stable-84594c9ecdca7ca595bc50e315093cb76921fd8e.tar.gz
linux-stable-84594c9ecdca7ca595bc50e315093cb76921fd8e.tar.bz2
linux-stable-84594c9ecdca7ca595bc50e315093cb76921fd8e.zip
ima: Move IMA-Appraisal to LSM infrastructure
A few additional IMA hooks are needed to reset the cached appraisal status, causing the file's integrity to be re-evaluated on next access. Register these IMA-appraisal only functions separately from the rest of IMA functions, as appraisal is a separate feature not necessarily enabled in the kernel configuration. Reuse the same approach as for other IMA functions, move hardcoded calls from various places in the kernel to the LSM infrastructure. Declare the functions as static and register them as hook implementations in init_ima_appraise_lsm(), called by init_ima_lsm(). Also move the inline function ima_inode_remove_acl() from the public ima.h header to ima_appraise.c. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Acked-by: Christian Brauner <brauner@kernel.org> Acked-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'fs/attr.c')
-rw-r--r--fs/attr.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/attr.c b/fs/attr.c
index 990e1b3a3c91..7e97313e7f70 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -17,7 +17,6 @@
#include <linux/filelock.h>
#include <linux/security.h>
#include <linux/evm.h>
-#include <linux/ima.h>
#include "internal.h"
@@ -503,7 +502,6 @@ int notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
if (!error) {
fsnotify_change(dentry, ia_valid);
security_inode_post_setattr(idmap, dentry, ia_valid);
- ima_inode_post_setattr(idmap, dentry, ia_valid);
evm_inode_post_setattr(idmap, dentry, ia_valid);
}