lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 25 Jul 2006 10:09:26 -0400
From:	Stephen Smalley <sds@...ho.nsa.gov>
To:	Darrel Goeddel <dgoeddel@...stedcs.com>,
	lkml <linux-kernel@...r.kernel.org>,
	James Morris <jmorris@...ei.org>, Andrew Morton <akpm@...l.org>
Subject: [patch 1/1] selinux: fix memory leak

From: Darrel Goeddel <dgoeddel@...stedCS.com>

This patch fixes a memory leak when a policydb structure
is destroyed.  Please apply for 2.6.18.

Signed-off-by: Darrel Goeddel <dgoeddel@...stedcs.com>
Signed-off-by: Stephen Smalley <sds@...ho.nsa.gov>
Acked-by:  James Morris <jmorris@...ei.org>

---

 security/selinux/ss/policydb.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -X /home/sds/dontdiff -rup linux-2.6.18-rc2-git2/security/selinux/ss/policydb.c linux-2.6.18-rc2-git2-x/security/selinux/ss/policydb.c
--- linux-2.6.18-rc2-git2/security/selinux/ss/policydb.c	2006-06-17 21:49:35.000000000 -0400
+++ linux-2.6.18-rc2-git2-x/security/selinux/ss/policydb.c	2006-07-24 11:31:54.000000000 -0400
@@ -644,10 +644,18 @@ void policydb_destroy(struct policydb *p
 	kfree(lra);
 
 	for (rt = p->range_tr; rt; rt = rt -> next) {
-		kfree(lrt);
+		if (lrt) {
+			ebitmap_destroy(&lrt->range.level[0].cat);
+			ebitmap_destroy(&lrt->range.level[1].cat);
+			kfree(lrt);
+		}
 		lrt = rt;
 	}
-	kfree(lrt);
+	if (lrt) {
+		ebitmap_destroy(&lrt->range.level[0].cat);
+		ebitmap_destroy(&lrt->range.level[1].cat);
+		kfree(lrt);
+	}
 
 	if (p->type_attr_map) {
 		for (i = 0; i < p->p_types.nprim; i++)

-- 
Stephen Smalley
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ