Android security tags, read closely by Lightrion

CVE-2024-34720 AI-generated analysis

platform/frameworks/base, Zygote (core/java/com/android/internal/os/ZygoteConnection.java, core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (3 corrections). Verify against the commit before relying on it.

Adds a peer-UID check (must be Process.SYSTEM_UID) when a Zygote connection is created in Java, and reworks the native nativeForkRepeatedly loop so that newly accepted connections are UID-checked immediately and dropped on mismatch instead of being handed, unchecked, back to the Java command handler.

Root cause

The Java ZygoteConnection constructor read the peer credentials but did not verify the UID. For generic Zygotes SELinux policy also restricts access, but App Zygotes are not covered: per the commit message, preload code running in one app zygote could connect to another app zygote's (randomly named) socket. In the native layer, com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly did fetch SO_PEERCRED, but the comparison against expected_uid was only at the top of the do/while loop. When a new connection was accepted inside the inner for(;;) loop, credentials were re-read at the end of that loop but the UID was only compared if the next command was a simple fork command (loop condition isSimpleForkCommand); for a non-fork command the function returned to Java, which then processed the command with no UID check. The old code also unconditionally closed the existing session socket before accept(), so a bad new connection cost the existing one.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to July 2024 · Findings