]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Jul 2023 19:39:13 +0000 (21:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Jul 2023 19:39:13 +0000 (21:39 +0200)
added patches:
xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch

queue-6.4/series
queue-6.4/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch [new file with mode: 0644]

index d986c4aed4785d6b9f076439e96e41bd88f8f38b..1b26258b56670f003c840b074cab908ad88d6e7d 100644 (file)
@@ -1 +1,2 @@
+xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch
 tools-nolibc-x86_64-disable-stack-protector-for-_start.patch
diff --git a/queue-6.4/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch b/queue-6.4/xtensa-fix-lock_mm_and_find_vma-in-case-vma-not-found.patch
new file mode 100644 (file)
index 0000000..f16b1d7
--- /dev/null
@@ -0,0 +1,38 @@
+From 03f889378f33aa9a9d8e5f49ba94134cf6158090 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+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@gmail.com>
+
+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@gmail.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
+ }
+ /*