NetBpfLoad: disallow 32-bit userspace on 6.13+ kernels

This is basically a no-op as 32-bit netd already fails on android-mainline @ 6.13 (we're now at 6.14, 6.15 is coming in a few weeks).
I know this because we had to fix ACK 6.12, and didn't port it forward.

Note: AFAIK TV is planning to release on 25Q2 and then 27Q2,
so this 26Q2+ doesn't actually affect them till a year later in 27Q2.

Modern arm cores are dropping 32-bit cpu instruction decode support.
This already happened on Pixel 8+ (Tensor G3+) and is soon coming
to the GCE cloud machines underpinning our cuttlefish VMs
(this is very much an industry wide trend for modern aarch64 cores,
I believe all new application cores since 2023 have been 64-bit only).

Pixel 6a is AFAIK the last pixel with 32-bit application support,
and that is reaching EOL approximately in July 2027.
(while most test coverage is on Pixel 6/6pro which EOLs in Oct 2026)

Note though that this isn't a great example: AFAIK all Pixels
have had 64-bit system userspace (which is what we care about here)
The transition happened in the final Nexus, the year before Pixel 1.

This means we're going to start losing *any* remaining vestiges
of test coverage that we still (might) have.

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie8a5a5dafd2f0e20ef4651c3a69957fde374ae4b
This commit is contained in:
Maciej Żenczykowski 2025-05-16 11:07:51 -07:00
commit 1da1945e26

View file

@ -1795,6 +1795,19 @@ static int doLoad(char** argv, char * const envp[]) {
}
}
// Linux 6.12 was an LTS released at the end of 2024 (Nov 17),
// and was first supported by Android 16 / 25Q2 (released in June 2025).
// The next Linux LTS should be released near the end of 2025,
// and will likely be 6.18.
// Since officially Android only supports LTS, 6.13+ really means 6.18+,
// and won't be supported before 2026, most likely Android 17 / 26Q2.
// 6.13+ (implying 26Q2+) requires 64-bit userspace.
if (isUserspace32bit() && isAtLeastKernelVersion(6, 13, 0)) {
// due to previous check only reachable on Arm && (<=T kernel uprev || TV || Wear)
ALOGE("64-bit userspace required on 6.13+ kernels.");
return 1;
}
if (isAtLeast25Q2) {
FILE * f = fopen("/system/etc/init/netbpfload.rc", "re");
if (!f) {