其他分享
首页 > 其他分享> > android init时将此结点设置为2:/proc/sys/kernel/kptr_restrict

android init时将此结点设置为2:/proc/sys/kernel/kptr_restrict

作者:互联网

Result<Success> SetKptrRestrictAction(const BuiltinArguments&) {
    std::string path = KPTR_RESTRICT_PATH;

    if (!SetHighestAvailableOptionValue(path, KPTR_RESTRICT_MINVALUE, KPTR_RESTRICT_MAXVALUE)) {
        LOG(FATAL) << "Unable to set adequate kptr_restrict value!";
        return Error();
    }
    return Success();
}

#define KPTR_RESTRICT_PATH "/proc/sys/kernel/kptr_restrict"
#define KPTR_RESTRICT_MINVALUE 2
#define KPTR_RESTRICT_MAXVALUE 4

system\core\init\Security.cpp

 

android平台上,Android会将如下结点设置为2:

/proc/sys/kernel/kptr_restrict

 

标签:kernel,kptr,sys,KPTR,RESTRICT,proc
来源: https://www.cnblogs.com/aspirs/p/15362512.html