[PATCH 0/3] mm/vmalloc: fix vmalloc_dump_obj VA lookup

Ye Liu posted 3 patches 1 week, 1 day ago
There is a newer version of this series
mm/vmalloc.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
[PATCH 0/3] mm/vmalloc: fix vmalloc_dump_obj VA lookup
Posted by Ye Liu 1 week, 1 day ago
vmalloc_dump_obj() has two bugs that cause it to miss vmalloc
allocations, plus a minor optimization opportunity:

  1. PAGE_ALIGN() rounds up, pushing last-page addresses to va_end
     and outside the VA lookup range.

  2. The function searches only one vmap node, but allocations
     larger than 64 KiB may span multiple vmap zones whose VA
     is stored in a different node's rb-tree.

Patch 1 fixes the alignment, patch 2 fixes the cross-zone search,
patch 3 adds an early is_vmalloc_addr() check to skip non-vmalloc
addresses without traversing all nodes.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
Ye Liu (3):
      mm/vmalloc: fix vmalloc_dump_obj address alignment for last-page lookups
      mm/vmalloc: fix vmalloc_dump_obj cross-zone VA lookup
      mm/vmalloc: skip vmalloc_dump_obj for non-vmalloc addresses

 mm/vmalloc.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)
---
base-commit: e6e35979777d646fe3c7c94dca7dd32fb25d45f4
change-id: 20260916-vmalloc_dump_obj-d80908447369

Best regards,
-- 
Ye Liu <ye.liu@linux.dev>
Re: [PATCH 0/3] mm/vmalloc: fix vmalloc_dump_obj VA lookup
Posted by Andrew Morton 1 week, 1 day ago
On Wed, 16 Sep 2026 16:25:27 +0800 Ye Liu <ye.liu@linux.dev> wrote:

> vmalloc_dump_obj() has two bugs that cause it to miss vmalloc
> allocations, plus a minor optimization opportunity:
> 
>   1. PAGE_ALIGN() rounds up, pushing last-page addresses to va_end
>      and outside the VA lookup range.
> 
>   2. The function searches only one vmap node, but allocations
>      larger than 64 KiB may span multiple vmap zones whose VA
>      is stored in a different node's rb-tree.
> 
> Patch 1 fixes the alignment, patch 2 fixes the cross-zone search,
> patch 3 adds an early is_vmalloc_addr() check to skip non-vmalloc
> addresses without traversing all nodes.
> 

Thanks.  Sashiko asked a thing:
	https://sashiko.dev/#/patchset/20260916-vmalloc_dump_obj-v1-0-7aa402d224df@linux.dev