Commit 4f8f51dd authored by Jaihind Yadav's avatar Jaihind Yadav Committed by Kelsey Skunberg

selinux: ensure we cleanup the internal AVC counters on error in avc_update()

BugLink: https://bugs.launchpad.net/bugs/1868627

[ Upstream commit 030b995a ]

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: fa1aa143 ("selinux: extended permissions for ioctls")
Signed-off-by: default avatarJaihind Yadav <jaihindyadav@codeaurora.org>
Signed-off-by: default avatarRavi Kumar Siddojigari <rsiddoji@codeaurora.org>
[PM: merge fuzz, minor description cleanup]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 50016efd
......@@ -865,7 +865,7 @@ static int avc_update_node(u32 event, u32 perms, u8 driver, u8 xperm, u32 ssid,
if (orig->ae.xp_node) {
rc = avc_xperms_populate(node, orig->ae.xp_node);
if (rc) {
kmem_cache_free(avc_node_cachep, node);
avc_node_kill(node);
goto out_unlock;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment