aboutsummaryrefslogtreecommitdiffstats
path: root/init/init_task.c
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-05-28 18:03:40 +0100
committerWill Deacon <will@kernel.org>2020-05-28 18:03:40 +0100
commit082af5ec5080b028f7d0846a6c27cbb87f288205 (patch)
tree9b34b36586c9453628849fc5acee655012cb7b1e /init/init_task.c
parentMerge branch 'for-next/kvm/errata' into for-next/core (diff)
parentarm64: entry-ftrace.S: Update comment to indicate that x18 is live (diff)
downloadlinux-dev-082af5ec5080b028f7d0846a6c27cbb87f288205.tar.xz
linux-dev-082af5ec5080b028f7d0846a6c27cbb87f288205.zip
Merge branch 'for-next/scs' into for-next/core
Support for Clang's Shadow Call Stack in the kernel (Sami Tolvanen and Will Deacon) * for-next/scs: arm64: entry-ftrace.S: Update comment to indicate that x18 is live scs: Move DEFINE_SCS macro into core code scs: Remove references to asm/scs.h from core code scs: Move scs_overflow_check() out of architecture code arm64: scs: Use 'scs_sp' register alias for x18 scs: Move accounting into alloc/free functions arm64: scs: Store absolute SCS stack pointer value in thread_info efi/libstub: Disable Shadow Call Stack arm64: scs: Add shadow stacks for SDEI arm64: Implement Shadow Call Stack arm64: Disable SCS for hypervisor code arm64: vdso: Disable Shadow Call Stack arm64: efi: Restore register x18 if it was corrupted arm64: Preserve register x18 when CPU is suspended arm64: Reserve register x18 from general allocation with SCS scs: Disable when function graph tracing is enabled scs: Add support for stack usage debugging scs: Add page accounting for shadow call stack allocations scs: Add support for Clang's Shadow Call Stack (SCS)
Diffstat (limited to 'init/init_task.c')
-rw-r--r--init/init_task.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/init_task.c b/init/init_task.c
index bd403ed3e418..169e34066d35 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -11,6 +11,7 @@
#include <linux/mm.h>
#include <linux/audit.h>
#include <linux/numa.h>
+#include <linux/scs.h>
#include <asm/pgtable.h>
#include <linux/uaccess.h>
@@ -50,6 +51,13 @@ static struct sighand_struct init_sighand = {
.signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(init_sighand.signalfd_wqh),
};
+#ifdef CONFIG_SHADOW_CALL_STACK
+unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)]
+ __init_task_data = {
+ [(SCS_SIZE / sizeof(long)) - 1] = SCS_END_MAGIC
+};
+#endif
+
/*
* Set up the first task table, touch at your own risk!. Base=0,
* limit=0x1fffff (=2MB)