CONFIG_ILLEGAL_POINTER_VALUE

在config文件中有定义CONFIG_ILLEGAL_POINTER_VALUE为0xdead000000000000
#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 *) 0x200 + POISON_POINTER_DELTA)
这两个值的用途之一就是用在保护链表
static inline void list_del(struct list_head *entry)
{
	__list_del_entry(entry);
	entry->next = LIST_POISON1;
	entry->prev = LIST_POISON2;
}
如果在oops中报0xdead000000000100 或者0xdead000000000200 说明有人访问了已经释放的指针

 

你可能感兴趣的:(Linux,源码分析)