diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-06 09:36:10 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-06 09:36:10 +0100 |
| commit | a769f30c7bd7cf917eea05a2b448f3588a87d767 (patch) | |
| tree | 10a06089a9525926e23675528dd8190d05849143 /arch/powerpc/include/asm/stackprotector.h | |
| parent | 307a082484eb0201ad123f39f95510a9da11985b (diff) | |
| parent | d5adbfcd5f7bcc6fa58a41c5c5ada0e5c826ce2c (diff) | |
| download | lwn-a769f30c7bd7cf917eea05a2b448f3588a87d767.tar.gz lwn-a769f30c7bd7cf917eea05a2b448f3588a87d767.zip | |
Merge 4.10-rc7 into staging-next
This resolves the merge errors that were reported in linux-next and it
picks up the staging and IIO fixes that we need/want in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/include/asm/stackprotector.h')
| -rw-r--r-- | arch/powerpc/include/asm/stackprotector.h | 40 |
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 */ |
