From 21b4a05c738f32410932ab41aed3bb363116eaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Tue, 3 Sep 2024 15:46:48 -0700 Subject: [PATCH] NetBpfLoad: require 64-bit userspace on 6.7+ (sdk=36+) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This duplicates the previous check, but without the exceptions. Test: TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: Id83695689268baacd1112821fa3fd212c3aa0bb6 --- bpf/loader/NetBpfLoad.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp index 3300e922a6..2762687bdd 100644 --- a/bpf/loader/NetBpfLoad.cpp +++ b/bpf/loader/NetBpfLoad.cpp @@ -1523,6 +1523,12 @@ static int doLoad(char** argv, char * const envp[]) { if (!isTV() && !(isWear() && isArm())) return 1; } + // Note: 6.6 is highest version supported by Android V (sdk=35), so this is for sdk=36+ + if (isUserspace32bit() && isAtLeastKernelVersion(6, 7, 0)) { + ALOGE("64-bit userspace required on 6.7+ kernels."); + return 1; + } + // Ensure we can determine the Android build type. if (!isEng() && !isUser() && !isUserdebug()) { ALOGE("Failed to determine the build type: got %s, want 'eng', 'user', or 'userdebug'",