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]
Date:	Wed, 6 Aug 2008 23:22:33 +0600
From:	"Rakib Mullick" <rakib.mullick@...il.com>
To:	pj@....com, menage@...gle.com
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] cpuset : Handling improper memory allocation.

This patch makes sure that , if kmalloc fails in
"rebuild_sched_domains", then we've a place to go. If anything else,
please let me know.

Thanks.

Signed-off-by: Md.Rakib H. Mullick (rakib.mullick@...il.com)

--- linux-2.6.27-rc2.orig/kernel/cpuset.c	2008-08-06 16:23:26.000000000 +0600
+++ linux-2.6.27-rc2/kernel/cpuset.c	2008-08-06 23:07:59.504441992 +0600
@@ -615,7 +615,8 @@ void rebuild_sched_domains(void)
 		if (dattr) {
 			*dattr = SD_ATTR_INIT;
 			update_domain_attr_tree(dattr, &top_cpuset);
-		}
+		} else
+			goto rebuild;
 		*doms = top_cpuset.cpus_allowed;
 		goto rebuild;
 	}
@@ -685,6 +686,8 @@ restart:
 	if (!doms)
 		goto rebuild;
 	dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL);
+	if (!dattr)
+		goto rebuild;

 	for (nslot = 0, i = 0; i < csn; i++) {
 		struct cpuset *a = csa[i];
--
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