Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

slub: fix ksize() for zero-sized pointers

The slab and slob allocators already did this right, but slub would call
"get_object_page()" on the magic ZERO_SIZE_PTR, with all kinds of nasty
end results.

Noted by Ingo Molnar.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+1 -1
+1 -1
mm/slub.c
··· 2394 2394 struct page *page; 2395 2395 struct kmem_cache *s; 2396 2396 2397 - if (object == ZERO_SIZE_PTR) 2397 + if (ZERO_OR_NULL_PTR(object)) 2398 2398 return 0; 2399 2399 2400 2400 page = get_object_page(object);