]> www.infradead.org Git - users/hch/block.git/commit
selinux: avoid dereference of garbage after mount failure
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 28 Mar 2024 19:16:58 +0000 (20:16 +0100)
committerPaul Moore <paul@paul-moore.com>
Tue, 2 Apr 2024 03:32:35 +0000 (23:32 -0400)
commit37801a36b4d68892ce807264f784d818f8d0d39b
treef30921a08fef5c3237716ba481a00d51fb2e03db
parent4cece764965020c22cff7665b18a012006359095
selinux: avoid dereference of garbage after mount failure

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: 0619f0f5e36f ("selinux: wrap selinuxfs state")
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/selinuxfs.c