linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: fix add kasan bug
@ 2015-12-31 10:09 zhongjiang
  2016-01-04 21:13 ` Andrew Morton
  2016-01-05 10:10 ` Catalin Marinas
  0 siblings, 2 replies; 6+ messages in thread
From: zhongjiang @ 2015-12-31 10:09 UTC (permalink / raw)
  To: linux-kernel, ryabinin.a.a, linux-mm, catalin.marinas, akpm
  Cc: qiuxishi, zhongjiang, long.wanglong

From: zhong jiang <zhongjiang@huawei.com>

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 <zhongjiang@huawei.com>
---
 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 90c7ff2..45b5a7e 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -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__
-- 
2.0.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-08 18:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-31 10:09 [PATCH] arm64: fix add kasan bug zhongjiang
2016-01-04 21:13 ` Andrew Morton
2016-01-05 10:13   ` Catalin Marinas
2016-01-05 10:10 ` Catalin Marinas
2016-01-05 21:17   ` Andrey Ryabinin
2016-01-08 18:27     ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).