kernel-hacking-2024-linux-s.../arch/arm/mm
Imre Deak 1d2127123d ARM: 5742/1: ARM: add debug check for invalid kernel page faults
According to the following in arch/arm/mm/fault.c page faults from
kernel mode are invalid if mmap_sem is already held and there is
no exception handler defined for the faulting instruction:

/*
 * As per x86, we may deadlock here.  However, since the kernel only
 * validly references user space from well defined areas of the code,
 * we can bug out early if this is from code which shouldn't.
 */
if (!down_read_trylock(&mm->mmap_sem)) {
	if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
		goto no_context;

Since mmap_sem can be held at arbitrary times by another thread this
also means that any page faults from kernel mode are invalid if no
exception handler is defined for them, regardless whether mmap_sem is
held at the time of fault.

To easier detect code that can trigger the above error, add a check
also for the case where mmap_sem is acquired. As this has an overhead
make it a VM debug check.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-10-05 17:55:55 +01:00
..
abort-ev4.S
abort-ev4t.S
abort-ev5t.S
abort-ev5tj.S
abort-ev6.S Add core support for ARMv6/v7 big-endian 2009-05-30 14:00:18 +01:00
abort-ev7.S
abort-lv4t.S
abort-macro.S
abort-nommu.S
alignment.c Thumb-2: Implement the unified arch/arm/mm support 2009-07-24 12:32:56 +01:00
cache-fa.S
cache-feroceon-l2.c
cache-l2x0.c
cache-v3.S
cache-v4.S
cache-v4wb.S
cache-v4wt.S
cache-v6.S
cache-v7.S Thumb-2: Implement the unified arch/arm/mm support 2009-07-24 12:32:56 +01:00
cache-xsc3l2.c
context.c cpumask: use mm_cpumask() wrapper: arm 2009-09-24 09:34:49 +09:30
copypage-fa.c
copypage-feroceon.c
copypage-v3.c
copypage-v4mc.c
copypage-v4wb.c
copypage-v4wt.c
copypage-v6.c
copypage-xsc3.c
copypage-xscale.c
discontig.c
dma-mapping.c nommu: Add noMMU support to the DMA API 2009-07-24 12:35:02 +01:00
extable.c
fault-armv.c
fault.c ARM: 5742/1: ARM: add debug check for invalid kernel page faults 2009-10-05 17:55:55 +01:00
fault.h
flush.c cpumask: use mm_cpumask() wrapper: arm 2009-09-24 09:34:49 +09:30
highmem.c ARM: 5691/1: fix cache aliasing issues between kmap() and kmap_atomic() with highmem 2009-09-04 19:20:07 +01:00
init.c Merge branch 'origin' into for-linus 2009-09-24 21:22:33 +01:00
iomap.c
ioremap.c
Kconfig ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
Makefile ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
mm.h
mmap.c ARM: 5740/1: fix valid_phys_addr_range() range check 2009-10-02 22:32:34 +01:00
mmu.c ARM: Don't allow highmem on SMP platforms without h/w TLB ops broadcast 2009-09-28 18:06:20 +01:00
nommu.c nommu: Include asm/setup.h in arch/arm/mm/nommu.c 2009-07-24 12:35:03 +01:00
pabort-legacy.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
pabort-v6.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
pabort-v7.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
pgd.c
proc-arm6_7.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm7tdmi.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm9tdmi.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm720.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm740.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm920.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm922.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm925.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm926.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm940.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm946.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm1020.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm1020e.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm1022.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-arm1026.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-fa526.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-feroceon.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-macros.S Merge branch 'devel-stable' into devel 2009-09-12 12:02:26 +01:00
proc-mohawk.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-sa110.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-sa1100.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-syms.c [ARM] export __cpu_flush_dcache_page 2009-07-05 15:25:00 +01:00
proc-v6.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-v7.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-xsc3.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
proc-xscale.S ARM: 5727/1: Pass IFSR register to do_PrefetchAbort() 2009-10-02 22:34:32 +01:00
tlb-fa.S
tlb-v3.S
tlb-v4.S
tlb-v4wb.S
tlb-v4wbi.S
tlb-v6.S
tlb-v7.S Check whether the TLB operations need broadcasting on SMP systems 2009-05-30 14:00:14 +01:00