summaryrefslogtreecommitdiffstats
path: root/include/linux/poison.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/poison.h')
-rw-r--r--include/linux/poison.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/poison.h b/include/linux/poison.h
new file mode 100644
index 0000000000..b92eb2f95b
--- /dev/null
+++ b/include/linux/poison.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_POISON_H
+#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 *) 0x100 + POISON_POINTER_DELTA)
+#define LIST_POISON2 ((void *) 0x122 + POISON_POINTER_DELTA)
+
+#endif