@@ -39,10 +39,9 @@ extern struct crypto_shash *hash_tfm;
extern char *evm_config_xattrnames[];
int evm_init_key(void);
-int evm_update_evmxattr(struct dentry *dentry,
- const char *req_xattr_name,
- const char *req_xattr_value,
- size_t req_xattr_value_len);
+void evm_update_evmxattr(struct dentry *dentry, const char *req_xattr_name,
+ const char *req_xattr_value,
+ size_t req_xattr_value_len);
int evm_calc_hmac(struct dentry *dentry, const char *req_xattr_name,
const char *req_xattr_value,
size_t req_xattr_value_len, char *digest);
@@ -239,24 +239,22 @@ int evm_calc_hash(struct dentry *dentry, const char *req_xattr_name,
*
* Expects to be called with i_mutex locked.
*/
-int evm_update_evmxattr(struct dentry *dentry, const char *xattr_name,
- const char *xattr_value, size_t xattr_value_len)
+void evm_update_evmxattr(struct dentry *dentry, const char *xattr_name,
+ const char *xattr_value, size_t xattr_value_len)
{
struct inode *inode = d_backing_inode(dentry);
struct evm_ima_xattr_data xattr_data;
- int rc = 0;
+ int rc;
rc = evm_calc_hmac(dentry, xattr_name, xattr_value,
xattr_value_len, xattr_data.digest);
if (rc == 0) {
xattr_data.type = EVM_XATTR_HMAC;
- rc = __vfs_setxattr_noperm(dentry, XATTR_NAME_EVM,
- &xattr_data,
- sizeof(xattr_data), 0);
+ __vfs_setxattr_noperm(dentry, XATTR_NAME_EVM, &xattr_data,
+ sizeof(xattr_data), 0);
} else if (rc == -ENODATA && inode->i_op->removexattr) {
- rc = inode->i_op->removexattr(dentry, XATTR_NAME_EVM);
+ inode->i_op->removexattr(dentry, XATTR_NAME_EVM);
}
- return rc;
}
int evm_init_hmac(struct inode *inode, const struct xattr *lsm_xattr,
The return value of evm_update_evmxattr is never used. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> --- security/integrity/evm/evm.h | 7 +++---- security/integrity/evm/evm_crypto.c | 14 ++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-)