Commit fbd0506e authored by Roberto Sassu's avatar Roberto Sassu Committed by Paul Moore

ima: Align ima_inode_setxattr() definition with LSM infrastructure

Change ima_inode_setxattr() definition, so that it can be registered as
implementation of the inode_setxattr hook.
Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Reviewed-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Acked-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 0298c5a9
...@@ -188,8 +188,9 @@ static inline void ima_post_key_create_or_update(struct key *keyring, ...@@ -188,8 +188,9 @@ static inline void ima_post_key_create_or_update(struct key *keyring,
extern bool is_ima_appraise_enabled(void); extern bool is_ima_appraise_enabled(void);
extern void ima_inode_post_setattr(struct mnt_idmap *idmap, extern void ima_inode_post_setattr(struct mnt_idmap *idmap,
struct dentry *dentry, int ia_valid); struct dentry *dentry, int ia_valid);
extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, extern int ima_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
const void *xattr_value, size_t xattr_value_len); const char *xattr_name, const void *xattr_value,
size_t xattr_value_len, int flags);
extern int ima_inode_set_acl(struct mnt_idmap *idmap, extern int ima_inode_set_acl(struct mnt_idmap *idmap,
struct dentry *dentry, const char *acl_name, struct dentry *dentry, const char *acl_name,
struct posix_acl *kacl); struct posix_acl *kacl);
...@@ -212,10 +213,12 @@ static inline void ima_inode_post_setattr(struct mnt_idmap *idmap, ...@@ -212,10 +213,12 @@ static inline void ima_inode_post_setattr(struct mnt_idmap *idmap,
return; return;
} }
static inline int ima_inode_setxattr(struct dentry *dentry, static inline int ima_inode_setxattr(struct mnt_idmap *idmap,
struct dentry *dentry,
const char *xattr_name, const char *xattr_name,
const void *xattr_value, const void *xattr_value,
size_t xattr_value_len) size_t xattr_value_len,
int flags)
{ {
return 0; return 0;
} }
......
...@@ -750,8 +750,9 @@ static int validate_hash_algo(struct dentry *dentry, ...@@ -750,8 +750,9 @@ static int validate_hash_algo(struct dentry *dentry,
return -EACCES; return -EACCES;
} }
int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, int ima_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
const void *xattr_value, size_t xattr_value_len) const char *xattr_name, const void *xattr_value,
size_t xattr_value_len, int flags)
{ {
const struct evm_ima_xattr_data *xvalue = xattr_value; const struct evm_ima_xattr_data *xvalue = xattr_value;
int digsig = 0; int digsig = 0;
......
...@@ -2269,7 +2269,7 @@ int security_inode_setxattr(struct mnt_idmap *idmap, ...@@ -2269,7 +2269,7 @@ int security_inode_setxattr(struct mnt_idmap *idmap,
ret = cap_inode_setxattr(dentry, name, value, size, flags); ret = cap_inode_setxattr(dentry, name, value, size, flags);
if (ret) if (ret)
return ret; return ret;
ret = ima_inode_setxattr(dentry, name, value, size); ret = ima_inode_setxattr(idmap, dentry, name, value, size, flags);
if (ret) if (ret)
return ret; return ret;
return evm_inode_setxattr(idmap, dentry, name, value, size); return evm_inode_setxattr(idmap, dentry, name, value, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment