From 986579cd69b4c828d3c3a21ea015be5463ab8078 Mon Sep 17 00:00:00 2001 From: zhong jiang Date: Wed, 6 Jan 2016 10:47:50 +1100 Subject: [PATCH] arm64: fix add kasan bug In general, each process have 16kb stack space to use, but stack need extra space to store red_zone when kasan enable. the patch fix above question. Signed-off-by: zhong jiang Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Xishi Qiu Cc: Wang Long Signed-off-by: Andrew Morton --- arch/arm64/include/asm/thread_info.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 90c7ff233735d7..45b5a7efd0a920 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -23,13 +23,24 @@ #include +#ifdef CONFIG_KASAN +#define KASAN_STACK_ORDER 1 +#else +#define KASAN_STACK_ORDER 0 +#endif + #ifdef CONFIG_ARM64_4K_PAGES -#define THREAD_SIZE_ORDER 2 +#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) #elif defined(CONFIG_ARM64_16K_PAGES) -#define THREAD_SIZE_ORDER 0 +#define THREAD_SIZE_ORDER (0 + KASAN_STACK_ORDER) #endif +#ifdef CONFIG_KASAN +#define THREAD_SIZE 32768 +#else #define THREAD_SIZE 16384 +#endif + #define THREAD_START_SP (THREAD_SIZE - 16) #ifndef __ASSEMBLY__