diff options
author | Aaron Tomlin <atomlin@redhat.com> | 2014-09-12 09:16:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-09-19 06:35:23 -0400 |
commit | a70857e46dd13e87ae06bf0e64cb6a2d4f436265 (patch) | |
tree | 3be941f7657d57af4215c886763072701c6c2f6e /arch/x86/mm/fault.c | |
parent | d4311ff1a8da48d609db9500f121c15580dfeeb7 (diff) |
sched: Add helper for task stack page overrun checking
This facility is used in a few places so let's introduce
a helper function to improve code readability.
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dzickus@redhat.com
Cc: bmr@redhat.com
Cc: jcastillo@redhat.com
Cc: oleg@redhat.com
Cc: riel@redhat.com
Cc: prarit@redhat.com
Cc: jgh@redhat.com
Cc: minchan@kernel.org
Cc: mpe@ellerman.id.au
Cc: tglx@linutronix.de
Cc: hannes@cmpxchg.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1410527779-8133-3-git-send-email-atomlin@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index bc23a7043c65..6240bc7ae741 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -648,7 +648,6 @@ no_context(struct pt_regs *regs, unsigned long error_code, | |||
648 | unsigned long address, int signal, int si_code) | 648 | unsigned long address, int signal, int si_code) |
649 | { | 649 | { |
650 | struct task_struct *tsk = current; | 650 | struct task_struct *tsk = current; |
651 | unsigned long *stackend; | ||
652 | unsigned long flags; | 651 | unsigned long flags; |
653 | int sig; | 652 | int sig; |
654 | 653 | ||
@@ -708,8 +707,7 @@ no_context(struct pt_regs *regs, unsigned long error_code, | |||
708 | 707 | ||
709 | show_fault_oops(regs, error_code, address); | 708 | show_fault_oops(regs, error_code, address); |
710 | 709 | ||
711 | stackend = end_of_stack(tsk); | 710 | if (task_stack_end_corrupted(tsk)) |
712 | if (*stackend != STACK_END_MAGIC) | ||
713 | printk(KERN_EMERG "Thread overran stack, or stack corrupted\n"); | 711 | printk(KERN_EMERG "Thread overran stack, or stack corrupted\n"); |
714 | 712 | ||
715 | tsk->thread.cr2 = address; | 713 | tsk->thread.cr2 = address; |