Re: [PATCH] mm: fix the race on huge alloc failed

From: Matthew Wilcox

Date: Sat Aug 29 2026 - 11:37:00 EST


On Sat, Aug 29, 2026 at 07:00:34AM -0300, Guilherme Giacomo Simoes wrote:
> The race occurs because the reader (__vmf_anon_prepare()) checks
> `vma->anon->vma` without holding the mmap_lock and withou the
> READ_ONCE() macro. Since the writer (__anon_vma_prepare()) is holding the
> mmap_lock and updating the pointer, it creates a data race as the two
> access are not properly synchronized.

also this explanation is bogus. i don't have time to fix it right now.