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

 

上一篇:CentOS 7.6升级系统内核


下一篇:CentOS7-K8S基础环境命令