selinux: ensure we cleanup the internal AVC counters on error in avc_update()
authorJaihind Yadav <jaihindyadav@codeaurora.org>
Tue, 17 Dec 2019 11:55:47 +0000 (17:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:39 +0000 (08:36 +0100)
commit111749fba968225d0cb51cce7727c18276ce6c6f
tree96c14b82defe9ad14569003ff7f0175ba55e97a2
parent069d2385f381034ddc7218fa0df360d44a995238
selinux: ensure we cleanup the internal AVC counters on error in avc_update()

[ Upstream commit 030b995ad9ece9fa2d218af4429c1c78c2342096 ]

In AVC update we don't call avc_node_kill() when avc_xperms_populate()
fails, resulting in the avc->avc_cache.active_nodes counter having a
false value.  In last patch this changes was missed , so correcting it.

Fixes: fa1aa143ac4a ("selinux: extended permissions for ioctls")
Signed-off-by: Jaihind Yadav <jaihindyadav@codeaurora.org>
Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
[PM: merge fuzz, minor description cleanup]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/selinux/avc.c