x86/mm: Improve stack-overflow #PF handling
authorAndy Lutomirski <luto@kernel.org>
Wed, 31 Aug 2016 00:27:57 +0000 (17:27 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 8 Sep 2016 06:47:20 +0000 (08:47 +0200)
commit6271cfdfc0e4731b76921ef02fdd87409d71dfdf
treeb1af2c82308a83478a5407406b17bad499c3a222
parent2b3061c77ce7e429b25a25560ba088e8e7193a67
x86/mm: Improve stack-overflow #PF handling

If we get a page fault indicating kernel stack overflow, invoke
handle_stack_overflow().  To prevent us from overflowing the stack
again while handling the overflow (because we are likely to have
very little stack space left), call handle_stack_overflow() on the
double-fault stack.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/6d6cf96b3fb9b4c9aa303817e1dc4de0c7c36487.1472603235.git.luto@kernel.org
[ Minor edit. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/traps.h
arch/x86/kernel/traps.c
arch/x86/mm/fault.c