Skip to content

Commit bd75497

Browse files
author
Al Viro
committed
m68k: fix livelock in uaccess
m68k equivalent of 26178ec "x86: mm: consolidate VM_FAULT_RETRY handling" If e.g. get_user() triggers a page fault and a fatal signal is caught, we might end up with handle_mm_fault() returning VM_FAULT_RETRY and not doing anything to page tables. In such case we must *not* return to the faulting insn - that would repeat the entire thing without making any progress; what we need instead is to treat that as failed (user) memory access. Tested-by: Finn Thain <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent c9c3395 commit bd75497

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/m68k/mm/fault.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,11 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
138138
fault = handle_mm_fault(vma, address, flags, regs);
139139
pr_debug("handle_mm_fault returns %x\n", fault);
140140

141-
if (fault_signal_pending(fault, regs))
141+
if (fault_signal_pending(fault, regs)) {
142+
if (!user_mode(regs))
143+
goto no_context;
142144
return 0;
145+
}
143146

144147
/* The fault is fully completed (including releasing mmap lock) */
145148
if (fault & VM_FAULT_COMPLETED)

0 commit comments

Comments
 (0)