aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/evm/evm_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/integrity/evm/evm_main.c')
-rw-r--r--security/integrity/evm/evm_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
index 9685af330de5..c5ee1a7c5e8a 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -319,9 +319,12 @@ int evm_inode_setxattr(struct dentry *dentry, const char *xattr_name,
319{ 319{
320 const struct evm_ima_xattr_data *xattr_data = xattr_value; 320 const struct evm_ima_xattr_data *xattr_data = xattr_value;
321 321
322 if ((strcmp(xattr_name, XATTR_NAME_EVM) == 0) 322 if (strcmp(xattr_name, XATTR_NAME_EVM) == 0) {
323 && (xattr_data->type == EVM_XATTR_HMAC)) 323 if (!xattr_value_len)
324 return -EPERM; 324 return -EINVAL;
325 if (xattr_data->type != EVM_IMA_XATTR_DIGSIG)
326 return -EPERM;
327 }
325 return evm_protect_xattr(dentry, xattr_name, xattr_value, 328 return evm_protect_xattr(dentry, xattr_name, xattr_value,
326 xattr_value_len); 329 xattr_value_len);
327} 330}