diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-22 11:48:43 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-22 11:48:43 +0100 |
commit | f0e31e6745b616a10e67bef651307ab858a25d8e (patch) | |
tree | 823bee378ae120b2698a81d94f6750c37411b872 | |
parent | f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b (diff) | |
parent | d6a18d73f688a61d87630fcd48fbae46676ab854 (diff) |
Merge branch 'safe-poison-pointers' into auto-safe-poison-pointers-next
-rw-r--r-- | arch/x86/Kconfig | 5 | ||||
-rw-r--r-- | include/linux/poison.h | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 73f7fe8fd4d1..5c224834dea7 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1143,6 +1143,11 @@ config ARCH_MEMORY_PROBE def_bool X86_64 depends on MEMORY_HOTPLUG +config ILLEGAL_POINTER_VALUE + hex + default 0 if X86_32 + default 0xdead000000000000 if X86_64 + source "mm/Kconfig" config HIGHPTE diff --git a/include/linux/poison.h b/include/linux/poison.h index 9f31683728fd..f2de9a999f4a 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h @@ -2,13 +2,25 @@ #define _LINUX_POISON_H /********** include/linux/list.h **********/ + +/* + * Architectures might want to move the poison pointer offset + * into some well-recognized area such as 0xdead000000000000, + * that is also not mappable by user-space exploits: + */ +#ifdef CONFIG_ILLEGAL_POINTER_VALUE +# define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) +#else +# define POISON_POINTER_DELTA 0 +#endif + /* * These are non-NULL pointers that will result in page faults * under normal circumstances, used to verify that nobody uses * non-initialized list entries. */ -#define LIST_POISON1 ((void *) 0x00100100) -#define LIST_POISON2 ((void *) 0x00200200) +#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) +#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) /********** include/linux/timer.h **********/ /* |