This is a note to let you know that I've just added the patch titled xtensa: fix lock_mm_and_find_vma in case VMA not found to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 03f889378f33aa9a9d8e5f49ba94134cf6158090 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@xxxxxxxxx> Date: Sat, 1 Jul 2023 03:31:55 -0700 Subject: xtensa: fix lock_mm_and_find_vma in case VMA not found From: Max Filippov <jcmvbkbc@xxxxxxxxx> commit 03f889378f33aa9a9d8e5f49ba94134cf6158090 upstream. MMU version of lock_mm_and_find_vma releases the mm lock before returning when VMA is not found. Do the same in noMMU version. This fixes hang on an attempt to handle protection fault. Fixes: d85a143b69ab ("xtensa: fix NOMMU build with lock_mm_and_find_vma() conversion") Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- mm/nommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/mm/nommu.c +++ b/mm/nommu.c @@ -637,8 +637,13 @@ EXPORT_SYMBOL(find_vma); struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, unsigned long addr, struct pt_regs *regs) { + struct vm_area_struct *vma; + mmap_read_lock(mm); - return vma_lookup(mm, addr); + vma = vma_lookup(mm, addr); + if (!vma) + mmap_read_unlock(mm); + return vma; } /* Patches currently in stable-queue which might be from jcmvbkbc@xxxxxxxxx are queue-6.4/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch