linux/include/linux/poison.h

/* 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
#else
#define POISON_POINTER_DELTA
#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
#define LIST_POISON2

/********** include/linux/timer.h **********/
#define TIMER_ENTRY_STATIC

/********** mm/page_poison.c **********/
#define PAGE_POISON

/********** mm/page_alloc.c ************/

#define TAIL_MAPPING

/********** mm/slab.c **********/
/*
 * Magic nums for obj red zoning.
 * Placed in the first word before and the first word after an obj.
 */
#define SLUB_RED_INACTIVE
#define SLUB_RED_ACTIVE

/* ...and for poisoning */
#define POISON_INUSE
#define POISON_FREE
#define POISON_END

/********** arch/$ARCH/mm/init.c **********/
#define POISON_FREE_INITMEM

/********** fs/jbd/journal.c **********/
#define JBD_POISON_FREE
#define JBD2_POISON_FREE

/********** drivers/base/dmapool.c **********/
#define POOL_POISON_FREED
#define POOL_POISON_ALLOCATED

/********** drivers/atm/ **********/
#define ATM_POISON_FREE
#define ATM_POISON

/********** kernel/mutexes **********/
#define MUTEX_DEBUG_INIT
#define MUTEX_DEBUG_FREE
#define MUTEX_POISON_WW_CTX

/********** security/ **********/
#define KEY_DESTROY

/********** net/core/page_pool.c **********/
#define PP_SIGNATURE

/********** net/core/skbuff.c **********/
#define SKB_LIST_POISON_NEXT
/********** net/ **********/
#define NET_PTR_POISON

/********** kernel/bpf/ **********/
#define BPF_PTR_POISON

/********** VFS **********/
#define VFS_PTR_POISON

/********** lib/stackdepot.c **********/
#define STACK_DEPOT_POISON

#endif