diff options
author | Maciej Żenczykowski <maze@google.com> | 2023-10-08 23:42:19 -0700 |
---|---|---|
committer | Maciej Żenczykowski <maze@google.com> | 2023-10-10 02:31:23 +0000 |
commit | 50fdc95894d8283f43d81d3b5e2724a784fef64d (patch) | |
tree | 2d4c52015cdd5d143b6840ede6f36f8d6fdb0c78 /bpfloader/BpfLoader.cpp | |
parent | a00b2ad3dfcc10f74bc7604b7caccd15e2b54104 (diff) | |
download | bpf-50fdc95894d8283f43d81d3b5e2724a784fef64d.tar.gz |
bpfloader: remove things already enforced by networking bpf loader
There is no need / benefit to do(ing) it twice, so might as well
remove it from the non-mainline location.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9887d983714903731f26c9d2478983d8276bfdba
Diffstat (limited to 'bpfloader/BpfLoader.cpp')
-rw-r--r-- | bpfloader/BpfLoader.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp index e3fde1e..8d8ae4f 100644 --- a/bpfloader/BpfLoader.cpp +++ b/bpfloader/BpfLoader.cpp @@ -180,42 +180,6 @@ int main(int argc, char** argv) { (void)argc; android::base::InitLogging(argv, &android::base::KernelLogger); - if (!android::bpf::isAtLeastKernelVersion(4, 19, 0)) { - ALOGE("Android U QPR2 requires kernel 4.19."); - return 1; - } - - if (android::bpf::isUserspace32bit() && android::bpf::isAtLeastKernelVersion(6, 2, 0)) { - /* Android 14/U should only launch on 64-bit kernels - * T launches on 5.10/5.15 - * U launches on 5.15/6.1 - * So >=5.16 implies isKernel64Bit() - * - * We thus added a test to V VTS which requires 5.16+ devices to use 64-bit kernels. - * - * Starting with Android V, which is the first to support a post 6.1 Linux Kernel, - * we also require 64-bit userspace. - * - * There are various known issues with 32-bit userspace talking to various - * kernel interfaces (especially CAP_NET_ADMIN ones) on a 64-bit kernel. - * Some of these have userspace or kernel workarounds/hacks. - * Some of them don't... - * We're going to be removing the hacks. - * - * Additionally the 32-bit kernel jit support is poor, - * and 32-bit userspace on 64-bit kernel bpf ringbuffer compatibility is broken. - */ - ALOGE("64-bit userspace required on 6.2+ kernels."); - return 1; - } - - // 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; - } - // 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) @@ -263,14 +227,5 @@ int main(int argc, char** argv) { } } - 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; - } - return 0; } |