diff options
-rw-r--r-- | security/integrity/ima/ima_appraise.c | 2 | ||||
-rw-r--r-- | security/integrity/integrity.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 922685483bd3..7c8f41e618b6 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c | |||
@@ -378,6 +378,8 @@ int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, | |||
378 | result = ima_protect_xattr(dentry, xattr_name, xattr_value, | 378 | result = ima_protect_xattr(dentry, xattr_name, xattr_value, |
379 | xattr_value_len); | 379 | xattr_value_len); |
380 | if (result == 1) { | 380 | if (result == 1) { |
381 | if (!xattr_value_len || (xvalue->type >= IMA_XATTR_LAST)) | ||
382 | return -EINVAL; | ||
381 | ima_reset_appraise_flags(dentry->d_inode, | 383 | ima_reset_appraise_flags(dentry->d_inode, |
382 | (xvalue->type == EVM_IMA_XATTR_DIGSIG) ? 1 : 0); | 384 | (xvalue->type == EVM_IMA_XATTR_DIGSIG) ? 1 : 0); |
383 | result = 0; | 385 | result = 0; |
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h index c0379d13dbe1..9d1c2ebfe12a 100644 --- a/security/integrity/integrity.h +++ b/security/integrity/integrity.h | |||
@@ -61,6 +61,7 @@ enum evm_ima_xattr_type { | |||
61 | EVM_XATTR_HMAC, | 61 | EVM_XATTR_HMAC, |
62 | EVM_IMA_XATTR_DIGSIG, | 62 | EVM_IMA_XATTR_DIGSIG, |
63 | IMA_XATTR_DIGEST_NG, | 63 | IMA_XATTR_DIGEST_NG, |
64 | IMA_XATTR_LAST | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | struct evm_ima_xattr_data { | 67 | struct evm_ima_xattr_data { |