Skip to content

Commit 779cb19

Browse files
robertosassupcmoore
authored andcommitted
evm: Align evm_inode_post_setxattr() definition with LSM infrastructure
Change evm_inode_post_setxattr() definition, so that it can be registered as implementation of the inode_post_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 2b6a405 commit 779cb19

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

include/linux/evm.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ extern int evm_inode_setxattr(struct mnt_idmap *idmap,
3131
extern void evm_inode_post_setxattr(struct dentry *dentry,
3232
const char *xattr_name,
3333
const void *xattr_value,
34-
size_t xattr_value_len);
34+
size_t xattr_value_len,
35+
int flags);
3536
extern int evm_inode_copy_up_xattr(const char *name);
3637
extern int evm_inode_removexattr(struct mnt_idmap *idmap,
3738
struct dentry *dentry, const char *xattr_name);
@@ -56,7 +57,7 @@ static inline void evm_inode_post_set_acl(struct dentry *dentry,
5657
const char *acl_name,
5758
struct posix_acl *kacl)
5859
{
59-
return evm_inode_post_setxattr(dentry, acl_name, NULL, 0);
60+
return evm_inode_post_setxattr(dentry, acl_name, NULL, 0, 0);
6061
}
6162

6263
int evm_inode_init_security(struct inode *inode, struct inode *dir,
@@ -115,7 +116,8 @@ static inline int evm_inode_setxattr(struct mnt_idmap *idmap,
115116
static inline void evm_inode_post_setxattr(struct dentry *dentry,
116117
const char *xattr_name,
117118
const void *xattr_value,
118-
size_t xattr_value_len)
119+
size_t xattr_value_len,
120+
int flags)
119121
{
120122
return;
121123
}

security/integrity/evm/evm_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ bool evm_revalidate_status(const char *xattr_name)
753753
* @xattr_name: pointer to the affected extended attribute name
754754
* @xattr_value: pointer to the new extended attribute value
755755
* @xattr_value_len: pointer to the new extended attribute value length
756+
* @flags: flags to pass into filesystem operations
756757
*
757758
* Update the HMAC stored in 'security.evm' to reflect the change.
758759
*
@@ -761,7 +762,8 @@ bool evm_revalidate_status(const char *xattr_name)
761762
* i_mutex lock.
762763
*/
763764
void evm_inode_post_setxattr(struct dentry *dentry, const char *xattr_name,
764-
const void *xattr_value, size_t xattr_value_len)
765+
const void *xattr_value, size_t xattr_value_len,
766+
int flags)
765767
{
766768
if (!evm_revalidate_status(xattr_name))
767769
return;

security/security.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2367,7 +2367,7 @@ void security_inode_post_setxattr(struct dentry *dentry, const char *name,
23672367
if (unlikely(IS_PRIVATE(d_backing_inode(dentry))))
23682368
return;
23692369
call_void_hook(inode_post_setxattr, dentry, name, value, size, flags);
2370-
evm_inode_post_setxattr(dentry, name, value, size);
2370+
evm_inode_post_setxattr(dentry, name, value, size, flags);
23712371
}
23722372

23732373
/**

0 commit comments

Comments
 (0)