diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-09-26 04:52:38 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:38 -0400 |
commit | 0a4254058037eb172758961d0a5b94f4320a1425 (patch) | |
tree | e9e64daf007952322c7ab0671b2f2f841085c04d /arch/x86_64/kernel/process.c | |
parent | b62a5c740df1e3d49a97349fce0c6a23f633d7fe (diff) |
[PATCH] Add the canary field to the PDA area and the task struct
This patch adds the per thread cookie field to the task struct and the PDA.
Also it makes sure that the PDA value gets the new cookie value at context
switch, and that a new task gets a new cookie at task creation time.
Signed-off-by: Arjan van Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>
CC: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/process.c')
-rw-r--r-- | arch/x86_64/kernel/process.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index 9e9a70e50c72..fba8dfeda67c 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -625,6 +625,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
625 | unlazy_fpu(prev_p); | 625 | unlazy_fpu(prev_p); |
626 | write_pda(kernelstack, | 626 | write_pda(kernelstack, |
627 | task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); | 627 | task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); |
628 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
629 | write_pda(stack_canary, next_p->stack_canary); | ||
630 | /* | ||
631 | * Build time only check to make sure the stack_canary is at | ||
632 | * offset 40 in the pda; this is a gcc ABI requirement | ||
633 | */ | ||
634 | BUILD_BUG_ON(offsetof(struct x8664_pda, stack_canary) != 40); | ||
635 | #endif | ||
628 | 636 | ||
629 | /* | 637 | /* |
630 | * Now maybe reload the debug registers and handle I/O bitmaps | 638 | * Now maybe reload the debug registers and handle I/O bitmaps |