From: Suren Baghdasaryan Date: Thu, 20 Feb 2025 20:02:08 +0000 (-0800) Subject: mm: fix a crash due to vma_end_read() that should have been removed X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=41fa76e3fb00af4258f10ce7d3a81fbca6ca504b;p=users%2Fjedix%2Flinux-maple.git mm: fix a crash due to vma_end_read() that should have been removed Handling a vma lock failure due to vma being detached from under us got changed but vma_end_read() in that path was left untouched while it should have been removed. Remove it. Link: https://lkml.kernel.org/r/20250220200208.323769-1-surenb@google.com Fixes: 758f7664c3d1 ("mm: replace vm_lock and detached flag with a reference count") Signed-off-by: Suren Baghdasaryan Reported-by: Heiko Carstens Closes: https://lore.kernel.org/all/20250220185304.8313A7d-hca@linux.ibm.com/ Cc: Christian Brauner Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: Hugh Dickins Cc: Jann Horn Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Klara Modin Cc: Liam R. Howlett Cc: Lokesh Gidra Cc: Lorenzo Stoakes Cc: Mateusz Guzik Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Oleg Nesterov Cc: Pasha Tatashin Cc: "Paul E . McKenney" Cc: Peter Xu Cc: Peter Zijlstra (Intel) Cc: Shakeel Butt Cc: Shivank Garg Cc: Sourav Panda Cc: Stephen Rothwell Cc: Vlastimil Babka Cc: Wei Yang Cc: Will Deacon Signed-off-by: Andrew Morton --- diff --git a/mm/memory.c b/mm/memory.c index 1aeed8407267..698b9409750f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6458,7 +6458,6 @@ retry: if (IS_ERR_OR_NULL(vma)) { /* Check if the VMA got isolated after we found it */ if (PTR_ERR(vma) == -EAGAIN) { - vma_end_read(vma); count_vm_vma_lock_event(VMA_LOCK_MISS); /* The area was replaced with another one */ goto retry;