summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2009-02-03 10:52:12 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2009-02-03 10:52:12 +1100
commit8d8e883a284bc6aaba2284bbc98b7b35a5220115 (patch)
treea8a1eb2724f527ff0b5f111046ddf217d3f50a46 /include
parentd9e3236cf2debe025e6f852b6587e999382e51aa (diff)
parentf0e31e6745b616a10e67bef651307ab858a25d8e (diff)
Merge commit 'safe-poison-pointers/auto-safe-poison-pointers-next'
Diffstat (limited to 'include')
-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 **********/
/*