summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2009-01-06 10:54:48 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2009-01-06 10:54:48 +1100
commit439c4cff34bce913ddf0ace7ad76a82888a0b259 (patch)
tree44b3ac7296342eb2328024413016ad99643cb89a /include/linux
parentf4e1edf7c901311c1925de7b403673b5c82f1262 (diff)
parent286c12f72ad295bbc27cfe67b0922bfc09732af7 (diff)
Merge commit 'safe-poison-pointers/auto-safe-poison-pointers-next'
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/poison.h16
1 files changed, 14 insertions, 2 deletions
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 **********/
/*