linux/security/selinux/ss
Tom Rix 65de50969a selinux: fix double free
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>
2020-06-10 22:10:35 -04:00
..
avtab.c selinux: avtab_init() and cond_policydb_init() return void 2020-03-05 14:55:43 -05:00
avtab.h selinux: avtab_init() and cond_policydb_init() return void 2020-03-05 14:55:43 -05:00
conditional.c selinux: avtab_init() and cond_policydb_init() return void 2020-03-05 14:55:43 -05:00
conditional.h selinux: avtab_init() and cond_policydb_init() return void 2020-03-05 14:55:43 -05:00
constraint.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
context.c selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
context.h selinux: move context hashing under sidtab 2020-04-17 16:04:38 -04:00
ebitmap.c selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
ebitmap.h selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
hashtab.c selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
hashtab.h selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
mls_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mls.c selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
mls.h selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
policydb.c selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
policydb.h selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
services.c selinux: fix double free 2020-06-10 22:10:35 -04:00
services.h selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
sidtab.c selinux: move context hashing under sidtab 2020-04-17 16:04:38 -04:00
sidtab.h selinux: move context hashing under sidtab 2020-04-17 16:04:38 -04:00
symtab.c selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00
symtab.h selinux: do not allocate hashtabs dynamically 2020-05-01 16:34:57 -04:00