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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458601213-5835-1-git-send-email-colin.king@canonical.com>
Date:	Mon, 21 Mar 2016 23:00:13 +0000
From:	Colin King <colin.king@...onical.com>
To:	Paul Moore <paul@...l-moore.com>,
	Stephen Smalley <sds@...ho.nsa.gov>,
	Eric Paris <eparis@...isplace.org>,
	James Morris <james.l.morris@...cle.com>,
	"Serge E . Hallyn" <serge@...lyn.com>,
	Nick Kralevich <nnk@...gle.com>,
	Jeff Vander Stoep <jeffv@...gle.com>, selinux@...ho.nsa.gov,
	linux-security-module@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] selinux: fix memory leak on node_ptr on error return path

From: Colin Ian King <colin.king@...onical.com>

node_ptr is not being free'd if the list allocation fails, fix
this by kfree'ing it before exiting on the error path.

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 security/selinux/ss/conditional.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 456e1a9..5d010ef 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -332,6 +332,7 @@ static int cond_insertf(struct avtab *a, struct avtab_key *k, struct avtab_datum
 	list = kzalloc(sizeof(struct cond_av_list), GFP_KERNEL);
 	if (!list) {
 		rc = -ENOMEM;
+		kfree(node_ptr);
 		goto err;
 	}
 
-- 
2.7.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ