linux-kernel-test/arch/x86/mm
Eric Sandeen 7c9f8861e6 stackprotector: use canary at end of stack to indicate overruns at oops time
(Updated with a common max-stack-used checker that knows about
the canary, as suggested by Joe Perches)

Use a canary at the end of the stack to clearly indicate
at oops time whether the stack has ever overflowed.

This is a very simple implementation with a couple of
drawbacks:

1) a thread may legitimately use exactly up to the last
   word on the stack

 -- but the chances of doing this and then oopsing later seem slim

2) it's possible that the stack usage isn't dense enough
   that the canary location could get skipped over

 -- but the worst that happens is that we don't flag the overrun
 -- though this happens fairly often in my testing :(

With the code in place, an intentionally-bloated stack oops might
do:

BUG: unable to handle kernel paging request at ffff8103f84cc680
IP: [<ffffffff810253df>] update_curr+0x9a/0xa8
PGD 8063 PUD 0
Thread overran stack or stack corrupted
Oops: 0000 [1] SMP
CPU 0
...

... unless the stack overrun is so bad that it corrupts some other
thread.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-26 16:15:33 +02:00
..
discontig_32.c x86: undo visws/numaq build changes 2008-05-04 20:04:45 +02:00
dump_pagetables.c "make namespacecheck" fixes 2008-04-24 23:15:44 +02:00
extable.c x86: unify extable_{32|64}.c 2008-01-30 13:31:41 +01:00
fault.c stackprotector: use canary at end of stack to indicate overruns at oops time 2008-05-26 16:15:33 +02:00
highmem_32.c x86: unexport kmap_atomic_to_page 2008-04-30 23:15:34 +02:00
hugetlbpage.c x86: stricter check in follow_huge_addr() 2008-03-27 16:08:45 +01:00
init_32.c x86: fix app crashes after SMP resume 2008-05-13 19:36:12 +02:00
init_64.c hotplug-memory: make online_page() common 2008-04-28 08:58:17 -07:00
ioremap.c x86: ioremap ram check fix 2008-04-30 23:15:35 +02:00
k8topology_64.c acpi: get boot_cpu_id as early for k8_scan_nodes 2008-04-26 23:41:04 +02:00
Makefile x86: add common mm/pgtable.c 2008-04-24 23:57:30 +02:00
mmap.c x86: unify mmap_{32|64}.c 2008-01-30 13:31:10 +01:00
numa_64.c x86_64: fix setup_node_bootmem to support big mem excluding with memmap 2008-04-26 22:51:08 +02:00
pageattr-test.c x86: remove over noisy debug printk 2008-02-11 11:24:24 -08:00
pageattr.c x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range() 2008-04-30 23:15:35 +02:00
pat.c x86: fix crash on cpu hotplug on pat-incapable machines 2008-05-17 22:57:20 +02:00
pgtable_32.c x86: fix PAE pmd_bad bootup warning 2008-05-06 13:08:58 -07:00
pgtable.c x86: unify pgd ctor/dtor 2008-04-24 23:57:31 +02:00
srat_64.c "make namespacecheck" fixes 2008-04-24 23:15:44 +02:00