bpfloader: unconditionally set bpf_jit_enable=1
This should now be safe on Android V+
(we should have aged out of kernels that don't support this),
as we're not really considering R->S->T->U->V 4 OS version upgrade path
supported (without at least some work on the part of vendor/oem).
Note that 4.14 was the minimal version supported for U,
so presumably the minimal version for V is 4.19,
which happens to also be the only version < 5.4 (ie. where
this isn't already enforced).
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I70485b5da1aeba190218c06e8e5179f8b851cce1
diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp
index 0b8452e..fe22628 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -283,8 +283,7 @@
// kernel does not have CONFIG_BPF_JIT=y)
// 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;
+ if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n")) return 1;
// Enable JIT kallsyms export for privileged users only
// (Note: this (open) will fail with ENOENT 'No such file or directory' if