Set this node to 2: / proc / sys / kernel / kptr during Android init_ 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

Yes

On the android platform, the following points will be set up as 2:

/proc/sys/kernel/kptr_restrict

Yes

Similar Posts: