summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJaihind Yadav <jaihindyadav@codeaurora.org>2019-12-17 17:25:47 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-24 08:36:39 +0100
commit111749fba968225d0cb51cce7727c18276ce6c6f (patch)
tree96c14b82defe9ad14569003ff7f0175ba55e97a2 /security
parent069d2385f381034ddc7218fa0df360d44a995238 (diff)
downloadlinux-stable-111749fba968225d0cb51cce7727c18276ce6c6f.tar.gz
linux-stable-111749fba968225d0cb51cce7727c18276ce6c6f.tar.bz2
linux-stable-111749fba968225d0cb51cce7727c18276ce6c6f.zip
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>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/avc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 6646300f7ccb..d18cb32a242a 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -891,7 +891,7 @@ static int avc_update_node(struct selinux_avc *avc,
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(avc, node);
goto out_unlock;
}
}