MIPS: Handle page faults of executable but unreadable pages correctly.
authorRalf Baechle <ralf@linux-mips.org>
Thu, 23 Jul 2015 09:10:38 +0000 (11:10 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 3 Aug 2015 07:25:08 +0000 (09:25 +0200)
Without this we end taking execeptions in an endless loop hanging the
thread.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/fault.c

index 36c0f26..852a41c 100644 (file)
@@ -133,7 +133,8 @@ good_area:
 #endif
                                goto bad_area;
                        }
-                       if (!(vma->vm_flags & VM_READ)) {
+                       if (!(vma->vm_flags & VM_READ) &&
+                           exception_epc(regs) != address) {
 #if 0
                                pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] RI violation\n",
                                          raw_smp_processor_id(),