summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/stackprotector.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-01-24 21:37:20 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2017-01-24 21:37:43 +1100
commitf2574030b0e33263b8a1c28fa3c4fa9292283799 (patch)
treeebecfeff672d06af804fae955e46858ed591c683 /arch/powerpc/include/asm/stackprotector.h
parentf05fea5b3574a5926c53865eea27139bb40b2f2b (diff)
downloadtalos-op-linux-f2574030b0e33263b8a1c28fa3c4fa9292283799.tar.gz
talos-op-linux-f2574030b0e33263b8a1c28fa3c4fa9292283799.zip
powerpc: Revert the initial stack protector support
Unfortunately the stack protector support we merged recently only works on some toolchains. If the toolchain is built without glibc support everything works fine, but if glibc is built then it leads to a panic at boot. The solution is not rc5 material, so revert the support for now. This reverts commits: 6533b7c16ee5 ("powerpc: Initial stack protector (-fstack-protector) support") 902e06eb86cd ("powerpc/32: Change the stack protector canary value per task") Fixes: 6533b7c16ee5 ("powerpc: Initial stack protector (-fstack-protector) support") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/stackprotector.h')
-rw-r--r--arch/powerpc/include/asm/stackprotector.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/arch/powerpc/include/asm/stackprotector.h b/arch/powerpc/include/asm/stackprotector.h
deleted file mode 100644
index 6720190eabec..000000000000
--- a/arch/powerpc/include/asm/stackprotector.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * GCC stack protector support.
- *
- * Stack protector works by putting predefined pattern at the start of
- * the stack frame and verifying that it hasn't been overwritten when
- * returning from the function. The pattern is called stack canary
- * and gcc expects it to be defined by a global variable called
- * "__stack_chk_guard" on PPC. This unfortunately means that on SMP
- * we cannot have a different canary value per task.
- */
-
-#ifndef _ASM_STACKPROTECTOR_H
-#define _ASM_STACKPROTECTOR_H
-
-#include <linux/random.h>
-#include <linux/version.h>
-#include <asm/reg.h>
-
-extern unsigned long __stack_chk_guard;
-
-/*
- * Initialize the stackprotector canary value.
- *
- * NOTE: this must only be called from functions that never return,
- * and it must always be inlined.
- */
-static __always_inline void boot_init_stack_canary(void)
-{
- unsigned long canary;
-
- /* Try to get a semi random initial value. */
- get_random_bytes(&canary, sizeof(canary));
- canary ^= mftb();
- canary ^= LINUX_VERSION_CODE;
-
- current->stack_canary = canary;
- __stack_chk_guard = current->stack_canary;
-}
-
-#endif /* _ASM_STACKPROTECTOR_H */
OpenPOWER on IntegriCloud