x86/entry: Enable random_kstack_offset support
authorKees Cook <keescook@chromium.org>
Thu, 1 Apr 2021 23:23:45 +0000 (16:23 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 8 Apr 2021 12:05:20 +0000 (14:05 +0200)
commitfe950f6020338c8ac668ef823bb692d36b7542a2
tree5bc68b8faf68e62c10d31dd7cc121e4d7fcf8dd2
parent39218ff4c625dbf2e68224024fe0acaa60bcd51a
x86/entry: Enable random_kstack_offset support

Allow for a randomized stack offset on a per-syscall basis, with roughly
5-6 bits of entropy, depending on compiler and word size. Since the
method of offsetting uses macros, this cannot live in the common entry
code (the stack offset needs to be retained for the life of the syscall,
which means it needs to happen at the actual entry point).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210401232347.2791257-5-keescook@chromium.org
arch/x86/Kconfig
arch/x86/entry/common.c
arch/x86/include/asm/entry-common.h