poison.h 2.67 KB
Newer Older
1 2 3 4
#ifndef _LINUX_POISON_H
#define _LINUX_POISON_H

/********** include/linux/list.h **********/
5 6 7 8 9 10 11 12 13 14 15 16

/*
 * 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

17 18 19 20 21
/*
 * These are non-NULL pointers that will result in page faults
 * under normal circumstances, used to verify that nobody uses
 * non-initialized list entries.
 */
22 23
#define LIST_POISON1  ((void *) 0x00100100 + POISON_POINTER_DELTA)
#define LIST_POISON2  ((void *) 0x00200200 + POISON_POINTER_DELTA)
24

25 26 27 28 29 30 31
/********** include/linux/timer.h **********/
/*
 * Magic number "tsta" to indicate a static timer initializer
 * for the object debugging code.
 */
#define TIMER_ENTRY_STATIC	((void *) 0x74737461)

Akinobu Mita's avatar
Akinobu Mita committed
32 33 34
/********** mm/debug-pagealloc.c **********/
#define PAGE_POISON 0xaa

35 36 37 38 39
/********** mm/slab.c **********/
/*
 * Magic nums for obj red zoning.
 * Placed in the first word before and the first word after an obj.
 */
40 41
#define	RED_INACTIVE	0x09F911029D74E35BULL	/* when obj is inactive */
#define	RED_ACTIVE	0xD84156C5635688C0ULL	/* when obj is active */
42

43 44 45 46 47 48
#ifdef CONFIG_PHYS_ADDR_T_64BIT
#define MEMBLOCK_INACTIVE	0x3a84fb0144c9e71bULL
#else
#define MEMBLOCK_INACTIVE	0x44c9e71bUL
#endif

Christoph Lameter's avatar
Christoph Lameter committed
49 50 51
#define SLUB_RED_INACTIVE	0xbb
#define SLUB_RED_ACTIVE		0xcc

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
/* ...and for poisoning */
#define	POISON_INUSE	0x5a	/* for use-uninitialised poisoning */
#define POISON_FREE	0x6b	/* for use-after-free poisoning */
#define	POISON_END	0xa5	/* end-byte of poisoning */

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

/********** arch/ia64/hp/common/sba_iommu.c **********/
/*
 * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a
 * value of "SBAIOMMU POISON\0" for spill-over poisoning.
 */

/********** fs/jbd/journal.c **********/
67 68
#define JBD_POISON_FREE		0x5b
#define JBD2_POISON_FREE	0x5c
69 70 71 72 73

/********** drivers/base/dmapool.c **********/
#define	POOL_POISON_FREED	0xa7	/* !inuse */
#define	POOL_POISON_ALLOCATED	0xa9	/* !initted */

74 75
/********** drivers/atm/ **********/
#define ATM_POISON_FREE		0x12
Randy Dunlap's avatar
Randy Dunlap committed
76
#define ATM_POISON		0xdeadbeef
77

Randy Dunlap's avatar
Randy Dunlap committed
78 79 80 81
/********** net/ **********/
#define NEIGHBOR_DEAD		0xdeadbeef
#define NETFILTER_LINK_POISON	0xdead57ac

82 83 84 85
/********** kernel/mutexes **********/
#define MUTEX_DEBUG_INIT	0x11
#define MUTEX_DEBUG_FREE	0x22

86 87 88
/********** lib/flex_array.c **********/
#define FLEX_ARRAY_FREE	0x6c	/* for use-after-free poisoning */

89 90 91
/********** security/ **********/
#define KEY_DESTROY		0xbd

92 93 94
/********** sound/oss/ **********/
#define OSS_POISON_FREE		0xAB

95
#endif