Re: [PATCH 1/2] mm/vmalloc: acquire init_mm read lock on huge vmap promotion

From: Mike Rapoport

Date: Sat Jul 11 2026 - 06:24:19 EST


On Fri, Jul 10, 2026 at 11:49:18AM +0100, Lorenzo Stoakes wrote:
> Currently there is a nasty race between ptdump and vmap when attempting to
> map a huge P4D, PMD or PUD entry.
>
> This patch resolves the issue by simply having
> vmap_try_huge_[p4d,pud,pmd]() hold the mmap read lock on init_mm while
> invoking [p4d,pud,pmd]_free_[pud,pmd,pte]_page() and
> [p4d,pud,pmd]_set_huge().
>
> Fixes: b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page table")
> Cc: <stable@xxxxxxxxxxxxxxx>
> Reported-by: syzbot+fd95a72470f5a44e464c@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://lore.kernel.org/all/6a287988.39669fcc.33b062.00a0.GAE@xxxxxxxxxx/T/
> Link: https://lore.kernel.org/linux-mm/20260706203128.162335-1-devnexen@xxxxxxxxx/
> Signed-off-by: Lorenzo Stoakes <ljs@xxxxxxxxxx>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

> ---
> include/linux/mmap_lock.h | 1 +
> mm/pagewalk.c | 22 +++++++++++----------
> mm/vmalloc.c | 50 ++++++++++++++++++++++++++++++++++++++---------
> 3 files changed, 54 insertions(+), 19 deletions(-)

--
Sincerely yours,
Mike.