linux-stable/security
Tom Rix cd80735a43 selinux: fix double free
commit 65de50969a upstream.

Clang's static analysis tool reports these double free memory errors.

security/selinux/ss/services.c:2987:4: warning: Attempt to free released memory [unix.Malloc]
                        kfree(bnames[i]);
                        ^~~~~~~~~~~~~~~~
security/selinux/ss/services.c:2990:2: warning: Attempt to free released memory [unix.Malloc]
        kfree(bvalues);
        ^~~~~~~~~~~~~~

So improve the security_get_bools error handling by freeing these variables
and setting their return pointers to NULL and the return len to 0

Cc: stable@vger.kernel.org
Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-25 15:33:07 +02:00
..
apparmor apparmor: fix nnp subset test for unconfined 2020-06-25 15:32:52 +02:00
integrity ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init() 2020-06-22 09:05:26 +02:00
keys mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-22 09:05:01 +02:00
loadpin module: replace the existing LSM hook in init_module 2018-07-16 12:31:57 -07:00
selinux selinux: fix double free 2020-06-25 15:33:07 +02:00
smack Smack: slab-out-of-bounds in vsscanf 2020-06-22 09:05:08 +02:00
tomoyo tomoyo: Use atomic_t for statistics counter 2020-02-05 14:43:38 +00:00
yama Yama: Check for pid death before checking ancestry 2019-01-22 21:40:32 +01:00
commoncap.c exec: Always set cap_ambient in cap_bprm_set_creds 2020-06-03 08:19:38 +02:00
device_cgroup.c device_cgroup: fix RCU imbalance in error case 2019-04-27 09:36:40 +02:00
inode.c securityfs: fix use-after-free on symlink traversal 2019-05-25 18:23:42 +02:00
Kconfig Revert "x86/mm/legacy: Populate the user page-table with user pgd's" 2018-09-14 17:08:45 +02:00
lsm_audit.c missing barriers in some of unix_sock ->addr and ->path accesses 2019-03-19 13:12:41 +01:00
Makefile
min_addr.c
security.c LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00