Skip to content

Commit 5a25188

Browse files
xiongzhongjiangsfrothwell
authored andcommitted
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 <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Xishi Qiu <[email protected]> Cc: Wang Long <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 353aa3c commit 5a25188

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

arch/arm64/include/asm/thread_info.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,24 @@
2323

2424
#include <linux/compiler.h>
2525

26+
#ifdef CONFIG_KASAN
27+
#define KASAN_STACK_ORDER 1
28+
#else
29+
#define KASAN_STACK_ORDER 0
30+
#endif
31+
2632
#ifdef CONFIG_ARM64_4K_PAGES
27-
#define THREAD_SIZE_ORDER 2
33+
#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
2834
#elif defined(CONFIG_ARM64_16K_PAGES)
29-
#define THREAD_SIZE_ORDER 0
35+
#define THREAD_SIZE_ORDER (0 + KASAN_STACK_ORDER)
3036
#endif
3137

38+
#ifdef CONFIG_KASAN
39+
#define THREAD_SIZE 32768
40+
#else
3241
#define THREAD_SIZE 16384
42+
#endif
43+
3344
#define THREAD_START_SP (THREAD_SIZE - 16)
3445

3546
#ifndef __ASSEMBLY__

0 commit comments

Comments
 (0)