From: Anfei Date: Tue, 8 Jun 2010 14:16:49 +0000 (+0100) Subject: ARM: 6166/1: Proper prefetch abort handling on pre-ARMv6 X-Git-Tag: v2.6.35-rc3~14^2~2 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=5e27fb78df95e027723af2c90ecc9b4527ae59e9 ARM: 6166/1: Proper prefetch abort handling on pre-ARMv6 Instruction faults on pre-ARMv6 CPUs are interpreted as a 'translation fault', but do_translation_fault doesn't handle well if user mode trying to run instruction above TASK_SIZE, and result in the infinite retry of that instruction. CC: Signed-off-by: Anfei Zhou Signed-off-by: Russell King --- diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 92f5801..cbfb2ed 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -393,6 +393,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, if (addr < TASK_SIZE) return do_page_fault(addr, fsr, regs); + if (user_mode(regs)) + goto bad_area; + index = pgd_index(addr); /*