android_kernel_oneplus_sm8250/security
Tom Rix db71648e23 selinux: fix double free
commit 65de50969a77509452ae590e9449b70a22b923bb 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>
2021-05-20 12:26:09 +03:00
..
apparmor apparmor: don't try to replace stale label in ptraceme check 2020-06-11 21:13:57 +08:00
integrity ima: fix freeing ongoing ahash_request 2019-10-11 18:21:11 +02:00
keys Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.19.y' into android-4.19 2020-02-21 08:11:19 -08:00
loadpin
selinux selinux: fix double free 2021-05-20 12:26:09 +03:00
smack LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00
tomoyo tomoyo: Use atomic_t for statistics counter 2020-02-05 14:43:38 +00:00
yama
commoncap.c Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
device_cgroup.c device_cgroup: fix RCU imbalance in error case 2019-04-27 09:36:40 +02:00
inode.c This is the 4.19.46 stable release 2019-05-25 19:09:59 +02:00
Kconfig Restore "ANDROID: security,perf: Allow further restriction of perf_event_open" 2020-06-01 03:37:43 -07:00
Kconfig.hardening ANDROID: Fix allmodconfig build with CC=clang 2019-11-14 10:56:08 -08:00
lsm_audit.c missing barriers in some of unix_sock ->addr and ->path accesses 2019-03-19 13:12:41 +01:00
Makefile Revert existing FBE changes for ICE FBE 2020-04-24 15:19:09 -07:00
min_addr.c
security.c Revert existing FBE changes for ICE FBE 2020-04-24 15:19:09 -07:00