]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 6166/1: Proper prefetch abort handling on pre-ARMv6
authorAnfei <anfei.zhou@gmail.com>
Tue, 8 Jun 2010 14:16:49 +0000 (15:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:10:51 +0000 (11:10 -0700)
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 <anfei.zhou@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/mm/fault.c

index 10e06801afb38e9d0a60cdb8b8cd94d43bc9e139..3191cd6593477bd53fbf9b3031de39fe54b7f63f 100644 (file)
@@ -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);
 
        /*