diff options
author | Xiu Jianfeng <xiujianfeng@huawei.com> | 2022-07-01 10:24:35 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-07-28 08:22:15 +0200 |
commit | f4a0318f278d98d9492916722e85f258c2221f88 (patch) | |
tree | e1526c00daeb382c4e4af213fef62c74c5551796 /arch/powerpc/Kconfig | |
parent | powerpc: Move system_call_exception() to syscall.c (diff) | |
download | linux-f4a0318f278d98d9492916722e85f258c2221f88.tar.xz linux-f4a0318f278d98d9492916722e85f258c2221f88.zip |
powerpc: add support for syscall stack randomization
Add support for adding a random offset to the stack while handling
syscalls. This patch uses mftb() instead of get_random_int() for better
performance.
In order to avoid unconditional stack canaries on syscall entry (due to
the use of alloca()), also disable stack protector to avoid triggering
needless checks and slowing down the entry path. As there is no general
way to control stack protector coverage with a function attribute, this
must be disabled at the compilation unit level.
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220701082435.126596-3-xiujianfeng@huawei.com
Diffstat (limited to 'arch/powerpc/Kconfig')
-rw-r--r-- | arch/powerpc/Kconfig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 04499f22d06b..2daeaab21240 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -196,6 +196,7 @@ config PPC select HAVE_ARCH_KASAN if PPC_BOOK3E_64 select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN select HAVE_ARCH_KFENCE if PPC_BOOK3S_32 || PPC_8xx || 40x + select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET select HAVE_ARCH_KGDB select HAVE_ARCH_MMAP_RND_BITS select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT |