Skip to content

Commit d721c15

Browse files
robertosassumimizohar
authored andcommitted
evm: Don't return an error in evm_write_xattrs() if audit is not enabled
This patch avoids that evm_write_xattrs() returns an error when audit is not enabled. The ab variable can be NULL and still be passed to the other audit_log_() functions, as those functions do not include any instruction. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent 88016de commit d721c15

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

security/integrity/evm/evm_secfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
197197

198198
ab = audit_log_start(audit_context(), GFP_KERNEL,
199199
AUDIT_INTEGRITY_EVM_XATTR);
200-
if (!ab)
200+
if (!ab && IS_ENABLED(CONFIG_AUDIT))
201201
return -ENOMEM;
202202

203203
xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL);

0 commit comments

Comments
 (0)