diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-07-11 09:28:40 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.ibm.com> | 2018-07-22 14:49:11 -0400 |
commit | 3dd0f18c70d94ca2432c78c5735744429f071b0b (patch) | |
tree | 2e6f6197b0545d4ae84cdf35382981b0a0c0ecca | |
parent | 6eb864c1d9dd1ef32b88e03c3f49d8be0dab7dcf (diff) |
EVM: fix return value check in evm_write_xattrs()
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 <weiyongjun1@huawei.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
-rw-r--r-- | security/integrity/evm/evm_secfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index 637eb999e340..77de71b7794c 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c | |||
@@ -193,8 +193,8 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, | |||
193 | return -E2BIG; | 193 | return -E2BIG; |
194 | 194 | ||
195 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR); | 195 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR); |
196 | if (IS_ERR(ab)) | 196 | if (!ab) |
197 | return PTR_ERR(ab); | 197 | return -ENOMEM; |
198 | 198 | ||
199 | xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL); | 199 | xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL); |
200 | if (!xattr) { | 200 | if (!xattr) { |