2018-10-11 00:01:19 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LOG_TAG
|
|
|
|
#define LOG_TAG "bpfloader"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
2018-10-16 22:19:58 +02:00
|
|
|
#include <dirent.h>
|
2018-10-11 00:01:19 +02:00
|
|
|
#include <elf.h>
|
|
|
|
#include <error.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <linux/bpf.h>
|
|
|
|
#include <linux/unistd.h>
|
|
|
|
#include <net/if.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2022-02-08 00:15:48 +01:00
|
|
|
#include <android-base/logging.h>
|
2019-12-12 23:22:34 +01:00
|
|
|
#include <android-base/macros.h>
|
2019-01-11 12:22:05 +01:00
|
|
|
#include <android-base/properties.h>
|
2018-10-11 00:01:19 +02:00
|
|
|
#include <android-base/stringprintf.h>
|
2018-10-16 22:19:58 +02:00
|
|
|
#include <android-base/strings.h>
|
2018-10-11 00:01:19 +02:00
|
|
|
#include <android-base/unique_fd.h>
|
2018-10-16 22:19:58 +02:00
|
|
|
#include <libbpf_android.h>
|
2018-10-11 00:01:19 +02:00
|
|
|
#include <log/log.h>
|
|
|
|
#include <netdutils/Misc.h>
|
|
|
|
#include <netdutils/Slice.h>
|
2022-12-10 18:58:59 +01:00
|
|
|
#include "BpfSyscallWrappers.h"
|
2018-10-11 00:01:19 +02:00
|
|
|
#include "bpf/BpfUtils.h"
|
|
|
|
|
2018-10-16 22:19:58 +02:00
|
|
|
using android::base::EndsWith;
|
2022-06-03 17:41:04 +02:00
|
|
|
using android::bpf::domain;
|
2018-10-16 22:19:58 +02:00
|
|
|
using std::string;
|
2018-10-11 00:01:19 +02:00
|
|
|
|
2022-07-18 12:04:37 +02:00
|
|
|
bool exists(const char* const path) {
|
|
|
|
int v = access(path, F_OK);
|
|
|
|
if (!v) {
|
|
|
|
ALOGI("%s exists.", path);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (errno == ENOENT) return false;
|
|
|
|
ALOGE("FATAL: access(%s, F_OK) -> %d [%d:%s]", path, v, errno, strerror(errno));
|
|
|
|
abort(); // can only hit this if permissions (likely selinux) are screwed up
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isInProcessTethering() {
|
|
|
|
bool in = exists("/apex/com.android.tethering/etc/flag/in-process");
|
|
|
|
bool out = exists("/apex/com.android.tethering/etc/flag/out-of-process");
|
|
|
|
if (in && out) abort(); // bad build
|
|
|
|
|
|
|
|
// Handle cases where the module explicitly tells us
|
|
|
|
if (in) return true;
|
|
|
|
if (out) return false;
|
|
|
|
|
2022-07-20 13:51:54 +02:00
|
|
|
ALOGE("FATAL: cannot determine if Tethering is in or out of process.");
|
|
|
|
abort();
|
2022-07-18 12:04:37 +02:00
|
|
|
}
|
|
|
|
|
2022-06-03 17:41:04 +02:00
|
|
|
constexpr unsigned long long kTetheringApexDomainBitmask =
|
|
|
|
domainToBitmask(domain::tethering) |
|
|
|
|
domainToBitmask(domain::net_private) |
|
|
|
|
domainToBitmask(domain::net_shared) |
|
|
|
|
domainToBitmask(domain::netd_readonly) |
|
|
|
|
domainToBitmask(domain::netd_shared);
|
|
|
|
|
2022-07-01 19:01:44 +02:00
|
|
|
// Programs shipped inside the tethering apex should be limited to networking stuff,
|
|
|
|
// as KPROBE, PERF_EVENT, TRACEPOINT are dangerous to use from mainline updatable code,
|
|
|
|
// since they are less stable abi/api and may conflict with platform uses of bpf.
|
|
|
|
constexpr bpf_prog_type kTetheringApexAllowedProgTypes[] = {
|
|
|
|
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
|
|
|
|
BPF_PROG_TYPE_CGROUP_SKB,
|
|
|
|
BPF_PROG_TYPE_CGROUP_SOCK,
|
|
|
|
BPF_PROG_TYPE_SCHED_ACT,
|
|
|
|
BPF_PROG_TYPE_SCHED_CLS,
|
|
|
|
BPF_PROG_TYPE_SOCKET_FILTER,
|
|
|
|
BPF_PROG_TYPE_XDP,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Networking-related program types are limited to the Tethering Apex
|
|
|
|
// to prevent things from breaking due to conflicts on mainline updates
|
|
|
|
// (exception made for socket filters, ie. xt_bpf for potential use in iptables,
|
|
|
|
// or for attaching to sockets directly)
|
|
|
|
constexpr bpf_prog_type kPlatformAllowedProgTypes[] = {
|
|
|
|
BPF_PROG_TYPE_KPROBE,
|
|
|
|
BPF_PROG_TYPE_PERF_EVENT,
|
|
|
|
BPF_PROG_TYPE_SOCKET_FILTER,
|
|
|
|
BPF_PROG_TYPE_TRACEPOINT,
|
2022-07-20 01:13:49 +02:00
|
|
|
BPF_PROG_TYPE_UNSPEC, // Will be replaced with fuse bpf program type
|
2022-07-01 19:01:44 +02:00
|
|
|
};
|
|
|
|
|
2019-12-12 23:22:34 +01:00
|
|
|
// see b/162057235. For arbitrary program types, the concern is that due to the lack of
|
|
|
|
// SELinux access controls over BPF program attachpoints, we have no way to control the
|
|
|
|
// attachment of programs to shared resources (or to detect when a shared resource
|
|
|
|
// has one BPF program replace another that is attached there)
|
|
|
|
constexpr bpf_prog_type kVendorAllowedProgTypes[] = {
|
2022-03-09 02:27:09 +01:00
|
|
|
BPF_PROG_TYPE_SOCKET_FILTER,
|
2019-12-12 23:22:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-12-02 05:08:17 +01:00
|
|
|
const android::bpf::Location locations[] = {
|
2022-06-17 03:58:22 +02:00
|
|
|
// S+ Tethering mainline module (network_stack): tether offload
|
2021-01-15 08:36:32 +01:00
|
|
|
{
|
|
|
|
.dir = "/apex/com.android.tethering/etc/bpf/",
|
|
|
|
.prefix = "tethering/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = kTetheringApexDomainBitmask,
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kTetheringApexAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kTetheringApexAllowedProgTypes),
|
2021-01-15 08:36:32 +01:00
|
|
|
},
|
2022-06-17 03:58:22 +02:00
|
|
|
// T+ Tethering mainline module (shared with netd & system server)
|
|
|
|
// netutils_wrapper (for iptables xt_bpf) has access to programs
|
2022-05-12 10:47:05 +02:00
|
|
|
{
|
|
|
|
.dir = "/apex/com.android.tethering/etc/bpf/netd_shared/",
|
|
|
|
.prefix = "netd_shared/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = kTetheringApexDomainBitmask,
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kTetheringApexAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kTetheringApexAllowedProgTypes),
|
2022-05-12 10:47:05 +02:00
|
|
|
},
|
2022-06-17 03:58:22 +02:00
|
|
|
// T+ Tethering mainline module (shared with netd & system server)
|
|
|
|
// netutils_wrapper has no access, netd has read only access
|
|
|
|
{
|
|
|
|
.dir = "/apex/com.android.tethering/etc/bpf/netd_readonly/",
|
|
|
|
.prefix = "netd_readonly/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = kTetheringApexDomainBitmask,
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kTetheringApexAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kTetheringApexAllowedProgTypes),
|
2022-06-17 03:58:22 +02:00
|
|
|
},
|
|
|
|
// T+ Tethering mainline module (shared with system server)
|
2022-01-17 10:22:34 +01:00
|
|
|
{
|
|
|
|
.dir = "/apex/com.android.tethering/etc/bpf/net_shared/",
|
2022-04-21 15:31:33 +02:00
|
|
|
.prefix = "net_shared/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = kTetheringApexDomainBitmask,
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kTetheringApexAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kTetheringApexAllowedProgTypes),
|
2022-01-17 10:22:34 +01:00
|
|
|
},
|
2022-06-17 03:58:22 +02:00
|
|
|
// T+ Tethering mainline module (not shared, just network_stack)
|
2022-05-12 10:47:05 +02:00
|
|
|
{
|
|
|
|
.dir = "/apex/com.android.tethering/etc/bpf/net_private/",
|
|
|
|
.prefix = "net_private/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = kTetheringApexDomainBitmask,
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kTetheringApexAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kTetheringApexAllowedProgTypes),
|
2022-05-12 10:47:05 +02:00
|
|
|
},
|
2021-01-15 08:36:32 +01:00
|
|
|
// Core operating system
|
|
|
|
{
|
|
|
|
.dir = "/system/etc/bpf/",
|
|
|
|
.prefix = "",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = domainToBitmask(domain::platform),
|
2022-07-01 19:01:44 +02:00
|
|
|
.allowedProgTypes = kPlatformAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kPlatformAllowedProgTypes),
|
2021-01-15 08:36:32 +01:00
|
|
|
},
|
2019-12-12 23:22:34 +01:00
|
|
|
// Vendor operating system
|
|
|
|
{
|
|
|
|
.dir = "/vendor/etc/bpf/",
|
|
|
|
.prefix = "vendor/",
|
2022-06-03 17:41:04 +02:00
|
|
|
.allowedDomainBitmask = domainToBitmask(domain::vendor),
|
2019-12-12 23:22:34 +01:00
|
|
|
.allowedProgTypes = kVendorAllowedProgTypes,
|
|
|
|
.allowedProgTypesLength = arraysize(kVendorAllowedProgTypes),
|
|
|
|
},
|
2021-01-15 08:36:32 +01:00
|
|
|
};
|
2018-10-11 00:01:19 +02:00
|
|
|
|
2022-12-02 05:08:17 +01:00
|
|
|
int loadAllElfObjects(const android::bpf::Location& location) {
|
2020-06-15 04:27:33 +02:00
|
|
|
int retVal = 0;
|
2018-10-16 22:19:58 +02:00
|
|
|
DIR* dir;
|
|
|
|
struct dirent* ent;
|
|
|
|
|
2019-12-12 23:22:34 +01:00
|
|
|
if ((dir = opendir(location.dir)) != NULL) {
|
2018-10-16 22:19:58 +02:00
|
|
|
while ((ent = readdir(dir)) != NULL) {
|
|
|
|
string s = ent->d_name;
|
|
|
|
if (!EndsWith(s, ".o")) continue;
|
|
|
|
|
2019-12-12 23:22:34 +01:00
|
|
|
string progPath(location.dir);
|
2020-09-10 09:51:59 +02:00
|
|
|
progPath += s;
|
2018-10-16 22:19:58 +02:00
|
|
|
|
2020-06-15 04:27:33 +02:00
|
|
|
bool critical;
|
2022-12-02 05:08:17 +01:00
|
|
|
int ret = android::bpf::loadProg(progPath.c_str(), &critical, location);
|
2020-06-15 04:27:33 +02:00
|
|
|
if (ret) {
|
|
|
|
if (critical) retVal = ret;
|
|
|
|
ALOGE("Failed to load object: %s, ret: %s", progPath.c_str(), std::strerror(-ret));
|
|
|
|
} else {
|
|
|
|
ALOGI("Loaded object: %s", progPath.c_str());
|
|
|
|
}
|
2018-10-16 22:19:58 +02:00
|
|
|
}
|
|
|
|
closedir(dir);
|
|
|
|
}
|
2020-06-15 04:27:33 +02:00
|
|
|
return retVal;
|
2018-10-16 22:19:58 +02:00
|
|
|
}
|
|
|
|
|
2022-12-05 14:33:43 +01:00
|
|
|
int createSysFsBpfSubDir(const char* const prefix) {
|
2021-01-15 08:36:32 +01:00
|
|
|
if (*prefix) {
|
|
|
|
mode_t prevUmask = umask(0);
|
|
|
|
|
|
|
|
string s = "/sys/fs/bpf/";
|
|
|
|
s += prefix;
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
int ret = mkdir(s.c_str(), S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO);
|
|
|
|
if (ret && errno != EEXIST) {
|
2022-12-05 14:33:43 +01:00
|
|
|
const int err = errno;
|
|
|
|
ALOGE("Failed to create directory: %s, ret: %s", s.c_str(), std::strerror(err));
|
|
|
|
return -err;
|
2021-01-15 08:36:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
umask(prevUmask);
|
|
|
|
}
|
2022-12-05 14:33:43 +01:00
|
|
|
return 0;
|
2021-01-15 08:36:32 +01:00
|
|
|
}
|
|
|
|
|
2022-12-03 10:38:05 +01:00
|
|
|
// Technically 'value' doesn't need to be newline terminated, but it's best
|
|
|
|
// to include a newline to match 'echo "value" > /proc/sys/...foo' behaviour,
|
|
|
|
// which is usually how kernel devs test the actual sysctl interfaces.
|
|
|
|
int writeProcSysFile(const char *filename, const char *value) {
|
|
|
|
android::base::unique_fd fd(open(filename, O_WRONLY | O_CLOEXEC));
|
|
|
|
if (fd < 0) {
|
|
|
|
const int err = errno;
|
|
|
|
ALOGE("open('%s', O_WRONLY | O_CLOEXEC) -> %s", filename, strerror(err));
|
|
|
|
return -err;
|
|
|
|
}
|
|
|
|
int len = strlen(value);
|
|
|
|
int v = write(fd, value, len);
|
|
|
|
if (v < 0) {
|
|
|
|
const int err = errno;
|
|
|
|
ALOGE("write('%s', '%s', %d) -> %s", filename, value, len, strerror(err));
|
|
|
|
return -err;
|
|
|
|
}
|
|
|
|
if (v != len) {
|
|
|
|
// In practice, due to us only using this for /proc/sys/... files, this can't happen.
|
|
|
|
ALOGE("write('%s', '%s', %d) -> short write [%d]", filename, value, len, v);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-02-08 00:15:48 +01:00
|
|
|
int main(int argc, char** argv) {
|
|
|
|
(void)argc;
|
|
|
|
android::base::InitLogging(argv, &android::base::KernelLogger);
|
|
|
|
|
2022-12-16 01:14:32 +01:00
|
|
|
// Ensure we can determine the Android build type.
|
|
|
|
if (!android::bpf::isEng() && !android::bpf::isUser() && !android::bpf::isUserdebug()) {
|
|
|
|
ALOGE("Failed to determine the build type: got %s, want 'eng', 'user', or 'userdebug'",
|
|
|
|
android::bpf::getBuildType().c_str());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2022-12-03 10:38:05 +01:00
|
|
|
// Linux 5.16-rc1 changed the default to 2 (disabled but changeable), but we need 0 (enabled)
|
|
|
|
// (this writeFile is known to fail on at least 4.19, but always defaults to 0 on pre-5.13,
|
|
|
|
// on 5.13+ it depends on CONFIG_BPF_UNPRIV_DEFAULT_OFF)
|
|
|
|
if (writeProcSysFile("/proc/sys/kernel/unprivileged_bpf_disabled", "0\n") &&
|
|
|
|
android::bpf::isAtLeastKernelVersion(5, 13, 0)) return 1;
|
|
|
|
|
|
|
|
// Enable the eBPF JIT -- but do note that on 64-bit kernels it is likely
|
2022-12-13 13:37:03 +01:00
|
|
|
// already force enabled by the kernel config option BPF_JIT_ALWAYS_ON.
|
2022-12-12 01:15:53 +01:00
|
|
|
// (Note: this (open) will fail with ENOENT 'No such file or directory' if
|
|
|
|
// kernel does not have CONFIG_BPF_JIT=y)
|
2022-12-13 13:37:03 +01:00
|
|
|
// BPF_JIT is required by R VINTF (which means 4.14/4.19/5.4 kernels),
|
|
|
|
// but 4.14/4.19 were released with P & Q, and only 5.4 is new in R+.
|
|
|
|
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n") &&
|
|
|
|
android::bpf::isAtLeastKernelVersion(5, 4, 0)) return 1;
|
2022-12-03 10:38:05 +01:00
|
|
|
|
|
|
|
// Enable JIT kallsyms export for privileged users only
|
2022-12-12 01:15:53 +01:00
|
|
|
// (Note: this (open) will fail with ENOENT 'No such file or directory' if
|
|
|
|
// kernel does not have CONFIG_HAVE_EBPF_JIT=y)
|
2022-12-13 13:37:03 +01:00
|
|
|
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_kallsyms", "1\n") &&
|
|
|
|
android::bpf::isAtLeastKernelVersion(5, 4, 0)) return 1;
|
2022-12-03 10:38:05 +01:00
|
|
|
|
2022-07-18 12:04:37 +02:00
|
|
|
// This is ugly... but this allows InProcessTethering which runs as system_server,
|
|
|
|
// instead of as network_stack to access /sys/fs/bpf/tethering, which would otherwise
|
|
|
|
// (due to genfscon rules) have fs_bpf_tethering selinux context, which is restricted
|
|
|
|
// to the network_stack process only (which is where out of process tethering runs)
|
|
|
|
if (isInProcessTethering() && !exists("/sys/fs/bpf/tethering")) {
|
2022-12-05 14:33:43 +01:00
|
|
|
if (createSysFsBpfSubDir(/* /sys/fs/bpf/ */ "net_shared")) return 1;
|
|
|
|
if (createSysFsBpfSubDir(/* /sys/fs/bpf/ */ "net_shared/tethering")) return 1;
|
2022-07-18 12:04:37 +02:00
|
|
|
|
|
|
|
/* /sys/fs/bpf/tethering -> net_shared/tethering */
|
|
|
|
if (symlink("net_shared/tethering", "/sys/fs/bpf/tethering")) {
|
|
|
|
ALOGE("symlink(net_shared/tethering, /sys/fs/bpf/tethering) -> %s", strerror(errno));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 17:41:04 +02:00
|
|
|
// Create all the pin subdirectories
|
|
|
|
// (this must be done first to allow selinux_context and pin_subdir functionality,
|
|
|
|
// which could otherwise fail with ENOENT during object pinning or renaming,
|
|
|
|
// due to ordering issues)
|
2019-12-12 23:22:34 +01:00
|
|
|
for (const auto& location : locations) {
|
2022-12-05 14:33:43 +01:00
|
|
|
if (createSysFsBpfSubDir(location.prefix)) return 1;
|
2022-06-03 17:41:04 +02:00
|
|
|
}
|
|
|
|
|
2022-12-05 14:33:43 +01:00
|
|
|
// Note: there's no actual src dir for fs_bpf_loader .o's,
|
|
|
|
// so it is not listed in 'locations[].prefix'.
|
|
|
|
// This is because this is primarily meant for triggering genfscon rules,
|
|
|
|
// and as such this will likely always be the case.
|
|
|
|
// Thus we need to manually create the /sys/fs/bpf/loader subdirectory.
|
|
|
|
if (createSysFsBpfSubDir("loader")) return 1;
|
|
|
|
|
2022-06-03 17:41:04 +02:00
|
|
|
// Load all ELF objects, create programs and maps, and pin them
|
|
|
|
for (const auto& location : locations) {
|
2019-12-12 23:22:34 +01:00
|
|
|
if (loadAllElfObjects(location) != 0) {
|
2021-01-15 08:36:32 +01:00
|
|
|
ALOGE("=== CRITICAL FAILURE LOADING BPF PROGRAMS FROM %s ===", location.dir);
|
2020-09-10 09:51:59 +02:00
|
|
|
ALOGE("If this triggers reliably, you're probably missing kernel options or patches.");
|
|
|
|
ALOGE("If this triggers randomly, you might be hitting some memory allocation "
|
|
|
|
"problems or startup script race.");
|
|
|
|
ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---");
|
|
|
|
sleep(20);
|
|
|
|
return 2;
|
|
|
|
}
|
2020-06-15 04:27:33 +02:00
|
|
|
}
|
2019-01-11 12:22:05 +01:00
|
|
|
|
2022-07-28 11:15:48 +02:00
|
|
|
int key = 1;
|
|
|
|
int value = 123;
|
|
|
|
android::base::unique_fd map(
|
|
|
|
android::bpf::createMap(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0));
|
|
|
|
if (android::bpf::writeToMapEntry(map, &key, &value, BPF_ANY)) {
|
|
|
|
ALOGE("Critical kernel bug - failure to write into index 1 of 2 element bpf map array.");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2019-01-11 12:22:05 +01:00
|
|
|
if (android::base::SetProperty("bpf.progs_loaded", "1") == false) {
|
2020-06-15 04:27:33 +02:00
|
|
|
ALOGE("Failed to set bpf.progs_loaded property");
|
2019-01-11 12:22:05 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2018-10-11 00:01:19 +02:00
|
|
|
}
|