Re: [PATCH] mm/mmap_lock: Reset maple state on lock_vma_under_rcu() retry

From: Andrew Morton

Date: Wed Nov 12 2025 - 15:24:48 EST


On Tue, 11 Nov 2025 21:18:19 -0500 "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx> wrote:

> > Prior to commit 0b16f8bed19c ("mm: change vma_start_read() to drop RCU
> > lock on failure"), vma_start_read() would drop rcu read lock and
> > return NULL, so the retry would not have happened. However, now that
> > vma_start_read() drops rcu read lock on failure followed by a retry,
> > we may end up using a freed maple tree node cached in the maple state.
>
> Yes, sounds good.
>
> Andrew, can you make this change and also drop Cc stable tag?

Done.

> This needs to be a hot fix, as Vlastimil said earlier.

Yup.