]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: add support for syscall stack randomization
authorXiu Jianfeng <xiujianfeng@huawei.com>
Fri, 1 Jul 2022 08:24:35 +0000 (16:24 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 28 Jul 2022 06:22:15 +0000 (16:22 +1000)
commitd1d0dc638a671f4c19af1e1ca106b5462759d4a8
treee1526c00daeb382c4e4af213fef62c74c5551796
parent824f04ff8a2504c3c8e81a860767e19f6e37c99e
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
arch/powerpc/Kconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/syscall.c