mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
SLUB's ksize() fails for size > 2048
I can't pass memory allocated by kmalloc() to ksize() if it is allocated by SLUB allocator and size is larger than (I guess) PAGE_SIZE / 2. The error of ksize() seems to be that it does not check if the allocation was made by SLUB or the page allocator. Reviewed-by: Pekka Enberg <[email protected]> Tested-by: Tetsuo Handa <[email protected]> Cc: Christoph Lameter <[email protected]>, Matt Mackall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
5a622f2d0f
commit
294a80a8ed
1 changed files with 5 additions and 1 deletions
|
|
@ -2558,8 +2558,12 @@ size_t ksize(const void *object)
|
|||
if (unlikely(object == ZERO_SIZE_PTR))
|
||||
return 0;
|
||||
|
||||
page = get_object_page(object);
|
||||
page = virt_to_head_page(object);
|
||||
BUG_ON(!page);
|
||||
|
||||
if (unlikely(!PageSlab(page)))
|
||||
return PAGE_SIZE << compound_order(page);
|
||||
|
||||
s = page->slab;
|
||||
BUG_ON(!s);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue