Skip to content

Commit

Permalink
EVM: fix return value check in evm_write_xattrs()
Browse files Browse the repository at this point in the history
In case of error, the function audit_log_start() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: fa516b6 ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
  • Loading branch information
Wei Yongjun authored and Mimi Zohar committed Jul 22, 2018
1 parent 6eb864c commit 3dd0f18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/integrity/evm/evm_secfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
return -E2BIG;

ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR);
if (IS_ERR(ab))
return PTR_ERR(ab);
if (!ab)
return -ENOMEM;

xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL);
if (!xattr) {
Expand Down

0 comments on commit 3dd0f18

Please sign in to comment.