提交 ce22bd92 编写于 作者: A Arjan van de Ven 提交者: Thomas Gleixner

x86: setup stack canary for the idle threads

The idle threads for non-boot CPUs are a bit special in how they
are created; the result is that these don't have the stack canary
set up properly in their PDA. Easiest fix is to just always set
the PDA up correctly when entering the idle thread; this is a NOP
for the boot cpu.
Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 e0032087
......@@ -146,6 +146,15 @@ static inline void play_dead(void)
void cpu_idle(void)
{
current_thread_info()->status |= TS_POLLING;
#ifdef CONFIG_CC_STACKPROTECTOR
/*
* If we're the non-boot CPU, nothing set the PDA stack
* canary up for us. This is as good a place as any for
* doing that.
*/
write_pda(stack_canary, current->stack_canary);
#endif
/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册