Commit bad5247a authored by Roberto Sassu's avatar Roberto Sassu Committed by Paul Moore
Browse files

ima: Align ima_inode_post_setattr() definition with LSM infrastructure



Change ima_inode_post_setattr() definition, so that it can be registered as
implementation of the inode_post_setattr hook (to be introduced).

Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Acked-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 54be6c6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ int notify_change(struct mnt_idmap *idmap, struct dentry *dentry,

	if (!error) {
		fsnotify_change(dentry, ia_valid);
		ima_inode_post_setattr(idmap, dentry);
		ima_inode_post_setattr(idmap, dentry, ia_valid);
		evm_inode_post_setattr(dentry, ia_valid);
	}

+2 −2
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ static inline void ima_post_key_create_or_update(struct key *keyring,
#ifdef CONFIG_IMA_APPRAISE
extern bool is_ima_appraise_enabled(void);
extern void ima_inode_post_setattr(struct mnt_idmap *idmap,
				   struct dentry *dentry);
				   struct dentry *dentry, int ia_valid);
extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
		       const void *xattr_value, size_t xattr_value_len);
extern int ima_inode_set_acl(struct mnt_idmap *idmap,
@@ -206,7 +206,7 @@ static inline bool is_ima_appraise_enabled(void)
}

static inline void ima_inode_post_setattr(struct mnt_idmap *idmap,
					  struct dentry *dentry)
					  struct dentry *dentry, int ia_valid)
{
	return;
}
+2 −1
Original line number Diff line number Diff line
@@ -629,6 +629,7 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)
 * ima_inode_post_setattr - reflect file metadata changes
 * @idmap:  idmap of the mount the inode was found from
 * @dentry: pointer to the affected dentry
 * @ia_valid: for the UID and GID status
 *
 * Changes to a dentry's metadata might result in needing to appraise.
 *
@@ -636,7 +637,7 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)
 * to lock the inode's i_mutex.
 */
void ima_inode_post_setattr(struct mnt_idmap *idmap,
			    struct dentry *dentry)
			    struct dentry *dentry, int ia_valid)
{
	struct inode *inode = d_backing_inode(dentry);
	struct integrity_iint_cache *iint;