From: Ye Liu vmalloc_dump_obj() unconditionally searches all vmap nodes even when called with a non-vmalloc address (e.g. a slab or stack pointer from mem_dump_obj()). Add an is_vmalloc_addr() check at the entry to avoid the unnecessary per-node trylock and rb-tree traversal. The KASAN caller already gates on is_vmalloc_addr(), but mem_dump_obj() calls vmalloc_dump_obj() before the fallback type check, so the guard in the callee covers both paths without requiring caller changes. Signed-off-by: Ye Liu --- mm/vmalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 30c610f678dc..b3e706fde202 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -5277,6 +5277,9 @@ bool vmalloc_dump_obj(void *object) unsigned long addr; unsigned long nr_pages; + if (!is_vmalloc_addr(object)) + return false; + addr = PAGE_ALIGN_DOWN((unsigned long) object); /* -- 2.25.1