summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-01-20 12:29:19 +0900
committerTejun Heo <tj@kernel.org>2009-01-20 12:29:19 +0900
commitc6e50f93db5bd0895ec7c7d1b6f3886c6e1f11b6 (patch)
tree3d6b2d04118bb61fb50cf7624aaf7f7e4f5916ce /arch/x86/include
parent7890ba8c87604ca4c2c73f7de846bf5305d743e4 (diff)
downloadblackbird-op-linux-c6e50f93db5bd0895ec7c7d1b6f3886c6e1f11b6.tar.gz
blackbird-op-linux-c6e50f93db5bd0895ec7c7d1b6f3886c6e1f11b6.zip
x86: cleanup stack protector
Impact: cleanup Make the following cleanups. * remove duplicate comment from boot_init_stack_canary() which fits better in the other place - cpu_idle(). * move stack_canary offset check from __switch_to() to boot_init_stack_canary(). Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/pda.h2
-rw-r--r--arch/x86/include/asm/stackprotector.h13
2 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/include/asm/pda.h b/arch/x86/include/asm/pda.h
index 5976cd803e9a..4a8c9d382c93 100644
--- a/arch/x86/include/asm/pda.h
+++ b/arch/x86/include/asm/pda.h
@@ -40,6 +40,4 @@ extern void pda_init(int);
#endif
-#define refresh_stack_canary() write_pda(stack_canary, current->stack_canary)
-
#endif /* _ASM_X86_PDA_H */
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
index c7f0d10bae7b..2383e5bb475c 100644
--- a/arch/x86/include/asm/stackprotector.h
+++ b/arch/x86/include/asm/stackprotector.h
@@ -16,13 +16,12 @@ static __always_inline void boot_init_stack_canary(void)
u64 tsc;
/*
- * 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).
- *
+ * Build time only check to make sure the stack_canary is at
+ * offset 40 in the pda; this is a gcc ABI requirement
+ */
+ BUILD_BUG_ON(offsetof(struct x8664_pda, stack_canary) != 40);
+
+ /*
* We both use the random pool and the current TSC as a source
* of randomness. The TSC only matters for very early init,
* there it already has some randomness on most systems. Later
OpenPOWER on IntegriCloud