From 818cc47b764cbdcb458aa34bbf4833a124381f83 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 14 Feb 2008 09:22:34 +0100 Subject: [PATCH] --- yaml --- r: 136347 b: refs/heads/master c: 7e09b2a02dae4616a5a26000169964b32f86cd35 h: refs/heads/master i: 136345: f9ad3bc8a9afa39064845d97b5e435e65ec86b0d 136343: 20f1721575c01f1b439cfda5242aba23b2e979be v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/process_64.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4e241647dc2e..9c0d38df220e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce22bd92cba0958e052cb1ce0f89f1d3a02b60a7 +refs/heads/master: 7e09b2a02dae4616a5a26000169964b32f86cd35 diff --git a/trunk/arch/x86/kernel/process_64.c b/trunk/arch/x86/kernel/process_64.c index 9e69e223023e..d4c7ac7aa430 100644 --- a/trunk/arch/x86/kernel/process_64.c +++ b/trunk/arch/x86/kernel/process_64.c @@ -150,9 +150,13 @@ void cpu_idle(void) #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. + * 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): */ + current->stack_canary = get_random_int(); write_pda(stack_canary, current->stack_canary); #endif /* endless idle loop with no priority at all */