Skip to content

Commit 784111d

Browse files
robertosassupcmoore
authored andcommitted
evm: Align evm_inode_post_setattr() definition with LSM infrastructure
Change evm_inode_post_setattr() definition, so that it can be registered as implementation of the inode_post_setattr hook (to be introduced). Signed-off-by: Roberto Sassu <[email protected]> Reviewed-by: Stefan Berger <[email protected]> Reviewed-by: Casey Schaufler <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Acked-by: Mimi Zohar <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent fec5f85 commit 784111d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

fs/attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ int notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
503503
if (!error) {
504504
fsnotify_change(dentry, ia_valid);
505505
ima_inode_post_setattr(idmap, dentry, ia_valid);
506-
evm_inode_post_setattr(dentry, ia_valid);
506+
evm_inode_post_setattr(idmap, dentry, ia_valid);
507507
}
508508

509509
return error;

include/linux/evm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
2323
struct integrity_iint_cache *iint);
2424
extern int evm_inode_setattr(struct mnt_idmap *idmap,
2525
struct dentry *dentry, struct iattr *attr);
26-
extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
26+
extern void evm_inode_post_setattr(struct mnt_idmap *idmap,
27+
struct dentry *dentry, int ia_valid);
2728
extern int evm_inode_setxattr(struct mnt_idmap *idmap,
2829
struct dentry *dentry, const char *name,
2930
const void *value, size_t size);
@@ -98,7 +99,8 @@ static inline int evm_inode_setattr(struct mnt_idmap *idmap,
9899
return 0;
99100
}
100101

101-
static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
102+
static inline void evm_inode_post_setattr(struct mnt_idmap *idmap,
103+
struct dentry *dentry, int ia_valid)
102104
{
103105
return;
104106
}

security/integrity/evm/evm_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ int evm_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
870870

871871
/**
872872
* evm_inode_post_setattr - update 'security.evm' after modifying metadata
873+
* @idmap: idmap of the idmapped mount
873874
* @dentry: pointer to the affected dentry
874875
* @ia_valid: for the UID and GID status
875876
*
@@ -879,7 +880,8 @@ int evm_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
879880
* This function is called from notify_change(), which expects the caller
880881
* to lock the inode's i_mutex.
881882
*/
882-
void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
883+
void evm_inode_post_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
884+
int ia_valid)
883885
{
884886
if (!evm_revalidate_status(NULL))
885887
return;

0 commit comments

Comments
 (0)