diff options
| author | J. Bruce Fields <bfields@redhat.com> | 2017-02-20 12:24:00 -0500 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2017-02-20 17:20:05 -0500 |
| commit | 60709c093ed39aadb0f09972ebbc96dc34eb372e (patch) | |
| tree | 983681311986070971d3756d9f8e75868aa7bb9a /arch/powerpc/include/asm/stackprotector.h | |
| parent | 7323f0d2881bbd426ce6bc0a956ef9e739ffe767 (diff) | |
| parent | 0839ffb83e44e5ff1843e932592525fc2bff23ff (diff) | |
| download | lwn-60709c093ed39aadb0f09972ebbc96dc34eb372e.tar.gz lwn-60709c093ed39aadb0f09972ebbc96dc34eb372e.zip | |
nfsd: merge stable fix into main nfsd branch
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 */ |
