0xdead000000000000是什么意思? [英] what is the meaning of 0xdead000000000000?

查看:330
本文介绍了0xdead000000000000是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此值出现在poison.h(Linux source \ include \ linux \ poison.h)中:

This value was appeared in the poison.h (linux source\include\linux\poison.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:
 */

我只是想知道值0xdead000000000000的特殊性吗?

I just curious about the special of the value 0xdead000000000000?

推荐答案

可以肯定,这只是Deadbeef的一种变体.即,它只是一个易于识别的信号值(有关Deadbeef的信息,请参见 http://en.wikipedia.org/wiki/Hexspeak )

Pretty sure this is just a variant of deadbeef; i.e. it's just an easily identified signal value (see http://en.wikipedia.org/wiki/Hexspeak for deadbeef)

指针中毒的想法是确保在不导致崩溃的情况下不能使用中毒的列表指针.假设您从结构所在的列表中取消链接该结构.然后,您想使指针值无效,以确保不再将其用于遍历列表.如果代码中有错误(悬空的指针引用),则您要确保任何试图通过此现在未链接的节点遵循列表的代码都立即崩溃(而不是稍后在某些可能无关的代码区域中崩溃).

The idea of pointer poisoning is to ensure that a poisoned list pointer can't be used without causing a crash. Say you unlink a structure from the list it was in. You then want to invalidate the pointer value to make sure it's not used again for traversing the list. If there's a bug somewhere in the code -- a dangling pointer reference -- you want to make sure that any code trying to follow the list through this now-unlinked node crashes immediately (rather than later in some possibly unrelated area of code).

当然,您可以简单地通过在指针或任何其他无效地址中放入空值来使指针中毒.使用0xdead000000000000作为基值,可以更轻松地将显式中毒的值与以0初始化或以0覆盖的值区分开.而且,它可以与偏移量(LIST_POISON {1,2})一起使用,以创建多个不同的有毒值,这些值均指向虚拟地址空间的不可用区域,一眼即可识别为无效.

Of course you can poison the pointer simply by putting a null value in it or any other invalid address. Using 0xdead000000000000 as the base value just makes it easier to distinguish an explicitly poisoned value from one that was initialized with zero or got overwritten with zeroes. And it can be used with an offset (LIST_POISON{1,2}) to create multiple distinct poison values that all point into unusable areas of the virtual address space and are identifiable as invalid at a glance.

这篇关于0xdead000000000000是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆