selinux: don't log MAC_POLICY_LOAD record on failed policy load
authorOndrej Mosnacek <omosnace@redhat.com>
Thu, 18 Mar 2021 21:53:01 +0000 (22:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:31:53 +0000 (14:31 +0200)
commit9731e08a338194db0d3b3212ed42ad2f06cedcc8
tree8388e96cca934881fa9699ad1fb8c39553ffa51e
parent3b87d0c5834b39295a7d152bab2f59250b29bca8
selinux: don't log MAC_POLICY_LOAD record on failed policy load

commit 519dad3bcd809dc1523bf80ab0310ddb3bf00ade upstream.

If sel_make_policy_nodes() fails, we should jump to 'out', not 'out1',
as the latter would incorrectly log an MAC_POLICY_LOAD audit record,
even though the policy hasn't actually been reloaded. The 'out1' jump
label now becomes unused and can be removed.

Fixes: 02a52c5c8c3b ("selinux: move policy commit after updating selinuxfs")
Cc: stable@vger.kernel.org
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/selinux/selinuxfs.c