Skip to content

Commit

Permalink
slub: fix slab_pad_check()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and Pekka Enberg committed Sep 14, 2009
1 parent 5788d8a commit 8a3d271
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8a3d271

Please sign in to comment.