Skip to contentSkip to conversation

arm64: fix add kasan bug

PATCH New zhongjiang 1 participant 1 message Dec 31, 2015 arm64

lore
Share & tools
lore

zhongjiang

author
#0 lore raw

PATCH 1/1 arm64: fix add kasan bug

From: zhong jiang <[email protected]>

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.

---
 arch/arm64/include/asm/thread_info.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
arch/arm64/include/asm/thread_info.h +13 -2
index 90c7ff2..45b5a7e 100644
@@ -23,13 +23,24 @@
 
 #include <linux/compiler.h>
 
+#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__
Signature · 1 line
2.0.0