aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-05-12 15:44:31 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-26 16:15:31 +0200
commitce22bd92cba0958e052cb1ce0f89f1d3a02b60a7 (patch)
tree48ab1d23836a9844b9848a5f4a075ceefe82aeef /arch/x86/kernel/process_64.c
parentx86: fix stackprotector canary updates during context switches (diff)
downloadlinux-dev-ce22bd92cba0958e052cb1ce0f89f1d3a02b60a7.tar.xz
linux-dev-ce22bd92cba0958e052cb1ce0f89f1d3a02b60a7.zip
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: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index d8640388039e..9e69e223023e 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -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();