linux/security
Colin Ian King 72acd64df4 EVM: Fix null dereference on xattr when xattr fails to allocate
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 ("Dereference after null check")

Fixes: fa516b66a1 ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2018-05-31 10:13:23 -04:00
..
apparmor + Features 2018-04-13 15:38:53 -07:00
integrity EVM: Fix null dereference on xattr when xattr fails to allocate 2018-05-31 10:13:23 -04:00
keys dh key: get rid of stack allocated array for zeroes 2018-05-11 13:07:49 -07:00
loadpin get rid of pointless includes of fs_struct.h 2018-02-22 14:28:50 -05:00
selinux selinux: provide socketpair callback 2018-05-04 12:48:54 -07:00
smack smack: provide socketpair callback 2018-05-04 12:48:54 -07:00
tomoyo net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
yama pids: introduce find_get_task_by_vpid() helper 2018-02-06 18:32:46 -08:00
commoncap.c commoncap: Handle memory allocation failure. 2018-04-10 19:17:41 -05:00
device_cgroup.c device_cgroup: prepare code for bpf-based device controller 2017-11-05 23:26:51 +09:00
inode.c securityfs: add the ability to support symlinks 2017-06-08 12:51:43 -07:00
Kconfig Currently, hardened usercopy performs dynamic bounds checking on slab 2018-02-03 16:25:42 -08:00
lsm_audit.c lsm_audit: update my email address 2017-08-17 15:33:39 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
min_addr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
security.c security: add hook for socketpair() 2018-05-04 12:48:54 -07:00