Skip to content

Commit 7fef92c

Browse files
Vasily GorbikMartin Schwidefsky
authored andcommitted
s390/kasan: double the stack size
Kasan stack instrumentation pads stack variables with redzones, which increases stack frames size significantly. Stack sizes are increased from 16k to 32k in the code, as well as for the kernel stack overflow detection option (CHECK_STACK). Reviewed-by: Martin Schwidefsky <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 42db5ed commit 7fef92c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

arch/s390/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding)
2727
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
2828
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
2929
UTS_MACHINE := s390x
30-
STACK_SIZE := 16384
30+
STACK_SIZE := $(if $(CONFIG_KASAN),32768,16384)
3131
CHECKFLAGS += -D__s390__ -D__s390x__
3232

3333
export LD_BFD

arch/s390/include/asm/thread_info.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
/*
1414
* General size of kernel stacks
1515
*/
16+
#ifdef CONFIG_KASAN
17+
#define THREAD_SIZE_ORDER 3
18+
#else
1619
#define THREAD_SIZE_ORDER 2
20+
#endif
1721
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
1822

1923
#ifndef __ASSEMBLY__

0 commit comments

Comments
 (0)