linux-stable/security
Christian Göttsche 68784a5d01 selinux: avoid dereference of garbage after mount failure
commit 37801a36b4 upstream.

In case kern_mount() fails and returns an error pointer return in the
error branch instead of continuing and dereferencing the error pointer.

While on it drop the never read static variable selinuxfs_mount.

Cc: stable@vger.kernel.org
Fixes: 0619f0f5e3 ("selinux: wrap selinuxfs state")
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:38:01 +02:00
..
apparmor
bpf
integrity
keys
landlock
loadpin
lockdown
safesetid
selinux
smack
tomoyo
yama
Kconfig
Kconfig.hardening
Makefile
commoncap.c
device_cgroup.c
inode.c
lsm_audit.c
lsm_syscalls.c
min_addr.c
security.c