slub: fix slab_pad_check()
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 3 Sep 2009 14:08:06 +0000 (16:08 +0200)
committerPekka Enberg <penberg@cs.helsinki.fi>
Mon, 14 Sep 2009 04:57:55 +0000 (07:57 +0300)
When SLAB_POISON is used and slab_pad_check() finds an overwrite of the
slab padding, we call restore_bytes() on the whole slab, not only
on the padding.

Acked-by: Christoph Lameer <cl@linux-foundation.org>
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c

index d73f771d278fc6eec475e34621f735c0cfda8661..b1cb2dfa109ad7d0f317669055b4bc4fb2291280 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -655,7 +655,7 @@ static int slab_pad_check(struct kmem_cache *s, struct page *page)
        slab_err(s, page, "Padding overwritten. 0x%p-0x%p", fault, end - 1);
        print_section("Padding", end - remainder, remainder);
 
-       restore_bytes(s, "slab padding", POISON_INUSE, start, end);
+       restore_bytes(s, "slab padding", POISON_INUSE, end - remainder, end);
        return 0;
 }