public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]i386: fix overflow in vmap on an x86 system which has more than 4GB memory.
@ 2006-09-15 15:34 Anatoli Antonovitch
  2006-09-23 17:26 ` Hugh Dickins
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoli Antonovitch @ 2006-09-15 15:34 UTC (permalink / raw)
  To: linux-kernel

Description
(max_mapnr << PAGE_SHIFT) would overflow on an x86 system which has more
than 4GB memory, and hence cause vmap to fail every time.


Signed-off-by: Michael Chen <micche@ati.com>

Patch
diff -Nur linux-2.4.21-40.EL/mm/vmalloc.c
linux-2.4.21-40.EL.diff/mm/vmalloc.c
--- linux-2.4.21-40.EL/mm/vmalloc.c     2006-02-02 21:13:20.000000000
-0600
+++ linux-2.4.21-40.EL.diff/mm/vmalloc.c        2006-09-04
11:29:33.000000000 -0500
@@ -298,8 +298,8 @@
        struct vm_struct *area;
        unsigned long size = count << PAGE_SHIFT;
 
-       if (!size || size > (max_mapnr << PAGE_SHIFT))
-               return NULL;
+    if (!count || count > max_mapnr)
+        return NULL;
        area = get_vm_area(size, flags);
        if (!area) {
                return NULL;



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-24  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 15:34 [PATCH]i386: fix overflow in vmap on an x86 system which has more than 4GB memory Anatoli Antonovitch
2006-09-23 17:26 ` Hugh Dickins
2006-09-23 23:55   ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox