Skip to content

Commit 2b6a405

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

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/linux/evm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern void evm_inode_post_setattr(struct mnt_idmap *idmap,
2727
struct dentry *dentry, int ia_valid);
2828
extern int evm_inode_setxattr(struct mnt_idmap *idmap,
2929
struct dentry *dentry, const char *name,
30-
const void *value, size_t size);
30+
const void *value, size_t size, int flags);
3131
extern void evm_inode_post_setxattr(struct dentry *dentry,
3232
const char *xattr_name,
3333
const void *xattr_value,
@@ -107,7 +107,7 @@ static inline void evm_inode_post_setattr(struct mnt_idmap *idmap,
107107

108108
static inline int evm_inode_setxattr(struct mnt_idmap *idmap,
109109
struct dentry *dentry, const char *name,
110-
const void *value, size_t size)
110+
const void *value, size_t size, int flags)
111111
{
112112
return 0;
113113
}

security/integrity/evm/evm_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ static int evm_protect_xattr(struct mnt_idmap *idmap,
581581
* @xattr_name: pointer to the affected extended attribute name
582582
* @xattr_value: pointer to the new extended attribute value
583583
* @xattr_value_len: pointer to the new extended attribute value length
584+
* @flags: flags to pass into filesystem operations
584585
*
585586
* Before allowing the 'security.evm' protected xattr to be updated,
586587
* verify the existing value is valid. As only the kernel should have
@@ -590,7 +591,7 @@ static int evm_protect_xattr(struct mnt_idmap *idmap,
590591
*/
591592
int evm_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
592593
const char *xattr_name, const void *xattr_value,
593-
size_t xattr_value_len)
594+
size_t xattr_value_len, int flags)
594595
{
595596
const struct evm_ima_xattr_data *xattr_data = xattr_value;
596597

security/security.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,7 +2272,7 @@ int security_inode_setxattr(struct mnt_idmap *idmap,
22722272
ret = ima_inode_setxattr(idmap, dentry, name, value, size, flags);
22732273
if (ret)
22742274
return ret;
2275-
return evm_inode_setxattr(idmap, dentry, name, value, size);
2275+
return evm_inode_setxattr(idmap, dentry, name, value, size, flags);
22762276
}
22772277

22782278
/**

0 commit comments

Comments
 (0)