summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-19 12:36:09 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-19 12:36:09 +0100
commit7890ba8c87604ca4c2c73f7de846bf5305d743e4 (patch)
treef3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /arch/x86/kernel/process_64.c
parent99937d6455cea95405ac681c86a857d0fcd530bd (diff)
parentb2b062b8163391c42b3219d466ca1ac9742b9c7b (diff)
downloadtalos-obmc-linux-7890ba8c87604ca4c2c73f7de846bf5305d743e4.tar.gz
talos-obmc-linux-7890ba8c87604ca4c2c73f7de846bf5305d743e4.zip
Merge branch 'stackprotector' into core/percpu
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 4523ff88a69d..aa89eabf09e0 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -16,6 +16,7 @@
#include <stdarg.h>
+#include <linux/stackprotector.h>
#include <linux/cpu.h>
#include <linux/errno.h>
#include <linux/sched.h>
@@ -117,6 +118,17 @@ static inline void play_dead(void)
void cpu_idle(void)
{
current_thread_info()->status |= TS_POLLING;
+
+ /*
+ * If we're the non-boot CPU, nothing set the PDA stack
+ * canary up for us - and if we are the boot CPU we have
+ * a 0 stack canary. This is a good place for updating
+ * it, as we wont ever return from this function (so the
+ * invalid canaries already on the stack wont ever
+ * trigger):
+ */
+ boot_init_stack_canary();
+
/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick(1);
@@ -627,7 +639,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
(unsigned long)task_stack_page(next_p) +
THREAD_SIZE - KERNEL_STACK_OFFSET);
#ifdef CONFIG_CC_STACKPROTECTOR
- write_pda(stack_canary, next_p->stack_canary);
/*
* Build time only check to make sure the stack_canary is at
* offset 40 in the pda; this is a gcc ABI requirement
OpenPOWER on IntegriCloud