From: Eric Dumazet Date: Thu, 3 Sep 2009 14:08:06 +0000 (+0200) Subject: slub: fix slab_pad_check() X-Git-Tag: v3.0~8026^2^3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a3d271deb0cc9c2fc47317d8e431046382939c9;p=platform%2Fkernel%2Flinux-amlogic.git slub: fix slab_pad_check() 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 Reported-by: Zdenek Kabelac Signed-off-by: Eric Dumazet Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index d73f771..b1cb2df 100644 --- 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; }