xref: /linux/include/linux/poison.h (revision 81819f0fc8285a2a5a921c019e3e3d7b6169d225)
1c9cf5528SRandy Dunlap #ifndef _LINUX_POISON_H
2c9cf5528SRandy Dunlap #define _LINUX_POISON_H
3c9cf5528SRandy Dunlap 
4c9cf5528SRandy Dunlap /********** include/linux/list.h **********/
5c9cf5528SRandy Dunlap /*
6c9cf5528SRandy Dunlap  * These are non-NULL pointers that will result in page faults
7c9cf5528SRandy Dunlap  * under normal circumstances, used to verify that nobody uses
8c9cf5528SRandy Dunlap  * non-initialized list entries.
9c9cf5528SRandy Dunlap  */
10c9cf5528SRandy Dunlap #define LIST_POISON1  ((void *) 0x00100100)
11c9cf5528SRandy Dunlap #define LIST_POISON2  ((void *) 0x00200200)
12c9cf5528SRandy Dunlap 
13c9cf5528SRandy Dunlap /********** mm/slab.c **********/
14c9cf5528SRandy Dunlap /*
15c9cf5528SRandy Dunlap  * Magic nums for obj red zoning.
16c9cf5528SRandy Dunlap  * Placed in the first word before and the first word after an obj.
17c9cf5528SRandy Dunlap  */
18c9cf5528SRandy Dunlap #define	RED_INACTIVE	0x5A2CF071UL	/* when obj is inactive */
19c9cf5528SRandy Dunlap #define	RED_ACTIVE	0x170FC2A5UL	/* when obj is active */
20c9cf5528SRandy Dunlap 
21*81819f0fSChristoph Lameter #define SLUB_RED_INACTIVE	0xbb
22*81819f0fSChristoph Lameter #define SLUB_RED_ACTIVE		0xcc
23*81819f0fSChristoph Lameter 
24c9cf5528SRandy Dunlap /* ...and for poisoning */
25c9cf5528SRandy Dunlap #define	POISON_INUSE	0x5a	/* for use-uninitialised poisoning */
26c9cf5528SRandy Dunlap #define POISON_FREE	0x6b	/* for use-after-free poisoning */
27c9cf5528SRandy Dunlap #define	POISON_END	0xa5	/* end-byte of poisoning */
28c9cf5528SRandy Dunlap 
29c9cf5528SRandy Dunlap /********** arch/$ARCH/mm/init.c **********/
30c9cf5528SRandy Dunlap #define POISON_FREE_INITMEM	0xcc
31c9cf5528SRandy Dunlap 
32c9cf5528SRandy Dunlap /********** arch/ia64/hp/common/sba_iommu.c **********/
33c9cf5528SRandy Dunlap /*
34c9cf5528SRandy Dunlap  * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a
35c9cf5528SRandy Dunlap  * value of "SBAIOMMU POISON\0" for spill-over poisoning.
36c9cf5528SRandy Dunlap  */
37c9cf5528SRandy Dunlap 
38c9cf5528SRandy Dunlap /********** fs/jbd/journal.c **********/
39c9cf5528SRandy Dunlap #define JBD_POISON_FREE	0x5b
40c9cf5528SRandy Dunlap 
41c9cf5528SRandy Dunlap /********** drivers/base/dmapool.c **********/
42c9cf5528SRandy Dunlap #define	POOL_POISON_FREED	0xa7	/* !inuse */
43c9cf5528SRandy Dunlap #define	POOL_POISON_ALLOCATED	0xa9	/* !initted */
44c9cf5528SRandy Dunlap 
45b3c681e0SRandy Dunlap /********** drivers/atm/ **********/
46b3c681e0SRandy Dunlap #define ATM_POISON_FREE		0x12
473c6b3773SRandy Dunlap #define ATM_POISON		0xdeadbeef
48b3c681e0SRandy Dunlap 
494bdbf6c0SRandy Dunlap /********** net/ **********/
504bdbf6c0SRandy Dunlap #define NEIGHBOR_DEAD		0xdeadbeef
514bdbf6c0SRandy Dunlap #define NETFILTER_LINK_POISON	0xdead57ac
524bdbf6c0SRandy Dunlap 
53a7807a32SRandy Dunlap /********** kernel/mutexes **********/
54a7807a32SRandy Dunlap #define MUTEX_DEBUG_INIT	0x11
55a7807a32SRandy Dunlap #define MUTEX_DEBUG_FREE	0x22
56a7807a32SRandy Dunlap 
57a7807a32SRandy Dunlap /********** security/ **********/
58a7807a32SRandy Dunlap #define KEY_DESTROY		0xbd
59a7807a32SRandy Dunlap 
60b3c681e0SRandy Dunlap /********** sound/oss/ **********/
61b3c681e0SRandy Dunlap #define OSS_POISON_FREE		0xAB
62b3c681e0SRandy Dunlap 
63c9cf5528SRandy Dunlap #endif
64