Android security tags, read closely by Lightrion

CVE-2026-28668 AI-generated analysis

platform/bionic, libc malloc allocation limit (libc/bionic/malloc_limit.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 (6 corrections). Verify against the commit before relying on it.

Removes the LimitFree(old_mem) call in bionic's LimitRealloc so that when a growing realloc is rejected by the Android allocation limit the original pointer is left untouched instead of being freed while the caller still holds it.

Root cause

In libc/bionic/malloc_limit.cpp, LimitRealloc(void* old_mem, size_t bytes) is the realloc path of the Android allocation limit code (enabled in the tests via android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, ...)). When the requested size grows the allocation and CheckLimit(bytes - old_usable_size) fails, the function logged a warning, called LimitFree(old_mem) and returned nullptr. Per the commit message this is invalid because the original pointer should not be changed: callers normally rely on realloc leaving the original block valid when it returns nullptr, so the caller was left holding a freed pointer that it could later use or free again.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2026 · Findings