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:	Fri, 1 Aug 2008 09:21:28 +0600
From:	"Rakib Mullick" <rakib.mullick@...il.com>
To:	pj@....com, menage@...gle.com
Cc:	linux-kernel@...r.kernel.org
Subject: [RESEND][PATCH] Removes extra checking in kernel/cpuset.c

Frist, thanks for sending comments about the patch. Now, in this
function what we're trying is to get a value for *pmask . After
setting *pmask value we again call 'cpus_intersects' , then if  'cs'
became NULL then a BUG_ON will be triggered from the last line of the
function. As Paul Jackson mentioned about two nits , so I resend it.
Hopefully my point is clear. If anything else please let me know.

Thanks a lot.

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

diff -upr linux-2.6.26-rc9.orig/kernel/cpuset.c linux-2.6.26-rc9/kernel/cpuset.c
--- linux-2.6.26-rc9.orig/kernel/cpuset.c	2008-08-01 08:38:41.000000000 +0600
+++ linux-2.6.26-rc9/kernel/cpuset.c	2008-08-01 08:33:37.000000000 +0600
@@ -282,11 +282,11 @@ static struct file_system_type cpuset_fs

 static void guarantee_online_cpus(const struct cpuset *cs, cpumask_t *pmask)
 {
-	while (cs && !cpus_intersects(cs->cpus_allowed, cpu_online_map))
-		cs = cs->parent;
-	if (cs)
+	if (cs) {
+		while (!cpus_intersects(cs->cpus_allowed, cpu_online_map))
+			cs = cs->parent;
 		cpus_and(*pmask, cs->cpus_allowed, cpu_online_map);
-	else
+	} else
 		*pmask = cpu_online_map;
 	BUG_ON(!cpus_intersects(*pmask, cpu_online_map));
 }
@@ -306,13 +306,13 @@ static void guarantee_online_cpus(const

 static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask)
 {
-	while (cs && !nodes_intersects(cs->mems_allowed,
+	if (cs) {
+		while (!nodes_intersects(cs->mems_allowed,
 					node_states[N_HIGH_MEMORY]))
-		cs = cs->parent;
-	if (cs)
+			cs = cs->parent;
 		nodes_and(*pmask, cs->mems_allowed,
 					node_states[N_HIGH_MEMORY]);
-	else
+	} else
 		*pmask = node_states[N_HIGH_MEMORY];
 	BUG_ON(!nodes_intersects(*pmask, node_states[N_HIGH_MEMORY]));
 }
--
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