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]
Message-Id: <20060806143241.19463.63953.sendpatchset@jackhammer.engr.sgi.com>
Date:	Sun, 06 Aug 2006 07:32:41 -0700
From:	Paul Jackson <pj@....com>
To:	Andrew Morton <akpm@...l.org>
Cc:	Christoph Hellwig <hch@...radead.org>,
	Con Kolivas <kernel@...ivas.org>,
	Marcelo Tosatti <marcelo@...ck.org>,
	Arjan van de Ven <arjan@...radead.org>,
	linux-kernel@...r.kernel.org,
	Nick Piggin <nickpiggin@...oo.com.au>,
	Christoph Lameter <clameter@....com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Paul Jackson <pj@....com>, Andi Kleen <ak@...e.de>
Subject: [PATCH] apply type enum zone_type fix

From: Paul Jackson <pj@....com>

The variable 'k' was changed from 'int' to 'enum zone_type'
(unsigned), and it was being tested for being '>= 0' in a loop.
Result was that the set_mempolicy(MPOL_BIND) system call crashed
the kernel in a near infinite loop off into the weeds.

Signed-off-by: Paul Jackson <pj@....com>

---

 mm/mempolicy.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- 2.6.18-rc3-mm1.orig/mm/mempolicy.c	2006-08-06 06:41:41.622684572 -0700
+++ 2.6.18-rc3-mm1/mm/mempolicy.c	2006-08-06 06:42:53.419522620 -0700
@@ -149,12 +149,16 @@ static struct zonelist *bind_zonelist(no
 	   lower zones etc. Avoid empty zones because the memory allocator
 	   doesn't like them. If you implement node hot removal you
 	   have to fix that. */
-	for (k = policy_zone; k >= 0; k--) { 
+	k = policy_zone;
+	while (1) {
 		for_each_node_mask(nd, *nodes) { 
 			struct zone *z = &NODE_DATA(nd)->node_zones[k];
 			if (z->present_pages > 0) 
 				zl->zones[num++] = z;
 		}
+		if (k == 0)
+			break;
+		k--;
 	}
 	zl->zones[num] = NULL;
 	return zl;

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@....com> 1.650.933.1373
-
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