Skip to content

Commit

Permalink
arm64: fix add kasan bug
Browse files Browse the repository at this point in the history
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>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Xishi Qiu <qiuxishi@huawei.com>
Cc: Wang Long <long.wanglong@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
xiongzhongjiang authored and sfrothwell committed Jan 5, 2016
1 parent 5c23fab commit 986579c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions arch/arm64/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit 986579c

Please sign in to comment.