diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2022-12-10 15:40:15 +0100 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-12-14 01:41:53 +0100 |
commit | 09f33601bf940f955c10a6e75a1c1b7bcadee5e2 (patch) | |
tree | 423542be6f130680ebf31b6f679af26cb764775a /arch/loongarch/kernel/asm-offsets.c | |
parent | LoongArch: Add hibernation (ACPI S4) support (diff) | |
download | linux-09f33601bf940f955c10a6e75a1c1b7bcadee5e2.tar.xz linux-09f33601bf940f955c10a6e75a1c1b7bcadee5e2.zip |
LoongArch: Add basic STACKPROTECTOR support
Add basic stack protector support similar to other architectures. A
constant canary value is set at boot time, and with help of compiler's
-fstack-protector we can detect stack corruption.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/asm-offsets.c')
-rw-r--r-- | arch/loongarch/kernel/asm-offsets.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-offsets.c index 4ef494577813..4bdb203fc66e 100644 --- a/arch/loongarch/kernel/asm-offsets.c +++ b/arch/loongarch/kernel/asm-offsets.c @@ -68,6 +68,9 @@ void output_task_defines(void) OFFSET(TASK_FLAGS, task_struct, flags); OFFSET(TASK_MM, task_struct, mm); OFFSET(TASK_PID, task_struct, pid); +#if defined(CONFIG_STACKPROTECTOR) + OFFSET(TASK_STACK_CANARY, task_struct, stack_canary); +#endif DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct)); BLANK(); } |