ima: Align ima_inode_removexattr() definition with LSM infrastructure
authorRoberto Sassu <roberto.sassu@huawei.com>
Thu, 15 Feb 2024 10:30:52 +0000 (11:30 +0100)
committerPaul Moore <paul@paul-moore.com>
Fri, 16 Feb 2024 04:43:39 +0000 (23:43 -0500)
Change ima_inode_removexattr() definition, so that it can be registered as
implementation of the inode_removexattr hook.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/ima.h
security/integrity/ima/ima_appraise.c
security/security.c

index 077324309c113f10fbcc2076b5ad20374c3bcbed..678a03fddd7e4277c2f83631b118526488a077b2 100644 (file)
@@ -200,7 +200,9 @@ static inline int ima_inode_remove_acl(struct mnt_idmap *idmap,
 {
        return ima_inode_set_acl(idmap, dentry, acl_name, NULL);
 }
-extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
+
+extern int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,
+                                const char *xattr_name);
 #else
 static inline bool is_ima_appraise_enabled(void)
 {
@@ -231,7 +233,8 @@ static inline int ima_inode_set_acl(struct mnt_idmap *idmap,
        return 0;
 }
 
-static inline int ima_inode_removexattr(struct dentry *dentry,
+static inline int ima_inode_removexattr(struct mnt_idmap *idmap,
+                                       struct dentry *dentry,
                                        const char *xattr_name)
 {
        return 0;
index cb2d0d11aa774cd9649314036bdd86b035d37370..36abc84ba299fbed4fc06799a25c9c6e5a98ea02 100644 (file)
@@ -790,7 +790,8 @@ int ima_inode_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
        return 0;
 }
 
-int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name)
+int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,
+                         const char *xattr_name)
 {
        int result;
 
index b4f6b7467e087103db2475320a7b5fedfb2b582b..58e20362b679c151c5ab4afb19c0b702f05a149d 100644 (file)
@@ -2430,7 +2430,7 @@ int security_inode_removexattr(struct mnt_idmap *idmap,
                ret = cap_inode_removexattr(idmap, dentry, name);
        if (ret)
                return ret;
-       ret = ima_inode_removexattr(dentry, name);
+       ret = ima_inode_removexattr(idmap, dentry, name);
        if (ret)
                return ret;
        return evm_inode_removexattr(idmap, dentry, name);