Skip to content

Commit 8e77bca

Browse files
Jaihind Yadavgregkh
authored andcommitted
selinux: ensure we cleanup the internal AVC counters on error in avc_update()
[ Upstream commit 030b995 ] 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: fa1aa14 ("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>
1 parent 3efbcdc commit 8e77bca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎security/selinux/avc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static int avc_update_node(struct selinux_avc *avc,
891891
if (orig->ae.xp_node) {
892892
rc = avc_xperms_populate(node, orig->ae.xp_node);
893893
if (rc) {
894-
kmem_cache_free(avc_node_cachep, node);
894+
avc_node_kill(avc, node);
895895
goto out_unlock;
896896
}
897897
}

0 commit comments

Comments
 (0)