From: Greg Kroah-Hartman Date: Sat, 1 Jul 2023 19:39:04 +0000 (+0200) Subject: 6.3-stable patches X-Git-Tag: v5.15.120~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a95468986aa7cd2639a370628c42eb51cccb9324;p=thirdparty%2Fkernel%2Fstable-queue.git 6.3-stable patches added patches: series xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch --- diff --git a/queue-6.3/series b/queue-6.3/series new file mode 100644 index 00000000000..602d35c3a02 --- /dev/null +++ b/queue-6.3/series @@ -0,0 +1 @@ +xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch diff --git a/queue-6.3/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch b/queue-6.3/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch new file mode 100644 index 00000000000..f16b1d72f43 --- /dev/null +++ b/queue-6.3/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch @@ -0,0 +1,38 @@ +From 03f889378f33aa9a9d8e5f49ba94134cf6158090 Mon Sep 17 00:00:00 2001 +From: Max Filippov +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 + +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 +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + 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; + } + + /*