]> Git Repo - linux.git/commitdiff
EVM: fix return value check in evm_write_xattrs()
authorWei Yongjun <[email protected]>
Wed, 11 Jul 2018 13:28:40 +0000 (13:28 +0000)
committerMimi Zohar <[email protected]>
Sun, 22 Jul 2018 18:49:11 +0000 (14:49 -0400)
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: fa516b66a1bf ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
security/integrity/evm/evm_secfs.c

index 637eb999e3406df16d084f50e779ed73f34b2ca4..77de71b7794c947289832b7af0acbf07fc23ec95 100644 (file)
@@ -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) {
This page took 0.059146 seconds and 4 git commands to generate.