Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Mimi Zohar
Hi Dan, On Tue, 2018-05-29 at 12:05 +0300, Dan Carpenter wrote: > Not really related to this patch except I was looking at the function: > > security/integrity/evm/evm_secfs.c >191 ab = audit_log_start(NULL, GFP_KERNEL, > AUDIT_INTEGRITY_EVM_XATTR); >192 if

Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Mimi Zohar
Hi Dan, On Tue, 2018-05-29 at 12:05 +0300, Dan Carpenter wrote: > Not really related to this patch except I was looking at the function: > > security/integrity/evm/evm_secfs.c >191 ab = audit_log_start(NULL, GFP_KERNEL, > AUDIT_INTEGRITY_EVM_XATTR); >192 if

Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Mimi Zohar
Hi Colin, On Sun, 2018-05-27 at 23:55 +0100, Colin King wrote: > From: Colin Ian King > > In the case where the allocation of xattr fails and xattr is NULL, the > error exit return path via label 'out' will dereference xattr when > kfree'ing xattr-name. Fix this by only kfree'ing xattr->name

Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Mimi Zohar
Hi Colin, On Sun, 2018-05-27 at 23:55 +0100, Colin King wrote: > From: Colin Ian King > > In the case where the allocation of xattr fails and xattr is NULL, the > error exit return path via label 'out' will dereference xattr when > kfree'ing xattr-name. Fix this by only kfree'ing xattr->name

Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Dan Carpenter
Not really related to this patch except I was looking at the function: security/integrity/evm/evm_secfs.c 191 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR); 192 if (IS_ERR(ab)) 193 return PTR_ERR(ab); 194 195 xattr

Re: [PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-29 Thread Dan Carpenter
Not really related to this patch except I was looking at the function: security/integrity/evm/evm_secfs.c 191 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR); 192 if (IS_ERR(ab)) 193 return PTR_ERR(ab); 194 195 xattr

[PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-27 Thread Colin King
From: Colin Ian King In the case where the allocation of xattr fails and xattr is NULL, the error exit return path via label 'out' will dereference xattr when kfree'ing xattr-name. Fix this by only kfree'ing xattr->name and xattr when xattr is non-null. Detected by

[PATCH] EVM: Fix null dereference on xattr when xattr fails to allocate

2018-05-27 Thread Colin King
From: Colin Ian King In the case where the allocation of xattr fails and xattr is NULL, the error exit return path via label 'out' will dereference xattr when kfree'ing xattr-name. Fix this by only kfree'ing xattr->name and xattr when xattr is non-null. Detected by CoverityScan, CID#1469366