From 39be45ee5ca20b54cdcf74c77933acc3f560ed7c Mon Sep 17 00:00:00 2001 From: Anfei Date: Tue, 8 Jun 2010 15:16:49 +0100 Subject: [PATCH] ARM: 6166/1: Proper prefetch abort handling on pre-ARMv6 commit 5e27fb78df95e027723af2c90ecc9b4527ae59e9 upstream. 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. Signed-off-by: Anfei Zhou Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- arch/arm/mm/fault.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 10e06801afb3..3191cd659347 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -386,6 +386,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); /* -- 2.11.4.GIT