x86: Increase exception stack sizes
authorPeter Zijlstra <peterz@infradead.org>
Wed, 15 Sep 2021 14:19:46 +0000 (16:19 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 21 Sep 2021 11:57:43 +0000 (13:57 +0200)
It turns out that a single page of stack is trivial to overflow with
all the tracing gunk enabled. Raise the exception stacks to 2 pages,
which is still half the interrupt stacks, which are at 4 pages.

Reported-by: Michael Wang <yun.wang@linux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/YUIO9Ye98S5Eb68w@hirez.programming.kicks-ass.net
arch/x86/include/asm/page_64_types.h

index a8d4ad8..e9e2c3b 100644 (file)
@@ -15,7 +15,7 @@
 #define THREAD_SIZE_ORDER      (2 + KASAN_STACK_ORDER)
 #define THREAD_SIZE  (PAGE_SIZE << THREAD_SIZE_ORDER)
 
-#define EXCEPTION_STACK_ORDER (0 + KASAN_STACK_ORDER)
+#define EXCEPTION_STACK_ORDER (1 + KASAN_STACK_ORDER)
 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
 
 #define IRQ_STACK_ORDER (2 + KASAN_STACK_ORDER)