diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 61c1fadbc644..e774d3bf3a03 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -810,9 +811,16 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle) { struct thread_info *ti = task_thread_info(idle); +#ifdef CONFIG_STACKPROTECTOR + idle->stack_canary = get_random_canary(); +#endif + #ifdef CONFIG_PPC64 paca_ptrs[cpu]->__current = idle; paca_ptrs[cpu]->kstack = (unsigned long)ti + THREAD_SIZE - STACK_FRAME_OVERHEAD; +#ifdef CONFIG_STACKPROTECTOR + paca_ptrs[cpu]->canary = idle->stack_canary; +#endif #endif ti->cpu = cpu; secondary_ti = current_set[cpu] = ti;