path: root/kernel
diff options
authorDaniel Axtens <>2021-06-24 18:39:42 -0700
committerLinus Torvalds <>2021-06-24 19:40:54 -0700
commit7ca3027b726be681c8e6292b5a81ebcde7581710 (patch)
tree4834aca0a45837341108be0fd034cc4711173264 /kernel
parent185cca24e977411495d57ec71e43350b69c08e63 (diff)
mm/vmalloc: unbreak kasan vmalloc support
In commit 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings"), __vmalloc_node_range was changed such that __get_vm_area_node was no longer called with the requested/real size of the vmalloc allocation, but rather with a rounded-up size. This means that __get_vm_area_node called kasan_unpoision_vmalloc() with a rounded up size rather than the real size. This led to it allowing access to too much memory and so missing vmalloc OOBs and failing the kasan kunit tests. Pass the real size and the desired shift into __get_vm_area_node. This allows it to round up the size for the underlying allocators while still unpoisioning the correct quantity of shadow memory. Adjust the other call-sites to pass in PAGE_SHIFT for the shift value. Link: Link: Fixes: 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings") Signed-off-by: Daniel Axtens <> Tested-by: David Gow <> Reviewed-by: Nicholas Piggin <> Reviewed-by: Uladzislau Rezki (Sony) <> Tested-by: Andrey Konovalov <> Acked-by: Andrey Konovalov <> Cc: Dmitry Vyukov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions