mm: vmalloc allocator off by one
authorNick Piggin <npiggin@suse.de>
Wed, 19 Nov 2008 23:36:32 +0000 (15:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Nov 2008 02:49:58 +0000 (18:49 -0800)
Fix off by one bug in the KVA allocator that can leave gaps in the address
space.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmalloc.c

index ba6b0f5f7fac6dcce7a9e8a7c71f00e0e691d193..46aab4dbf618adbee6ac4fc272ffa9eb99b66a56 100644 (file)
@@ -362,7 +362,7 @@ retry:
                                goto found;
                }
 
-               while (addr + size >= first->va_start && addr + size <= vend) {
+               while (addr + size > first->va_start && addr + size <= vend) {
                        addr = ALIGN(first->va_end + PAGE_SIZE, align);
 
                        n = rb_next(&first->rb_node);