Android security tags, read closely by Lightrion

CVE-2026-59014 AI-generated analysis

platform/frameworks/native, libgui DisplayLuts / RenderEngine LutShader / SurfaceFlinger CompositionEngine OutputLayer

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 (5 corrections). Verify against the commit before relying on it.

Adds structural and bounds validation (isValid/getMaxEndOffset/getElementsNeededPerChannel) to gui::DisplayLuts and rejects invalid LUTs at readFromParcel with BAD_VALUE. LutShader::lutShader now skips invalid LUTs, sizes its read-only mmap from the ashmem region and no longer aborts on mmap failure. OutputLayer::writeLutToHWC only forwards LUTs that pass isValid().

Root cause

gui::DisplayLuts (fd, offsets, lutProperties) was unparceled in readFromParcel without any consistency checks. In libs/renderengine/skia/filters/LutShader.cpp LutShader::lutShader, the old code only required fd.ok(). It then computed an int fullLength from the last entry only (offsets[last] + size, or size*size*size*3 with unchecked int multiplication) and mmap'd fullLength*sizeof(float) bytes of the supplied fd with PROT_READ|PROT_WRITE. It called LOG_ALWAYS_FATAL("mmap failed") on failure and copied ptr..ptr+fullLength into a std::vector. Nothing tied fullLength to the actual ashmem region size. Offsets could be negative, offsets.size() could differ from lutProperties.size() (lutProperties[i] was indexed by the offsets index), dimension and size were unchecked, and per-LUT lengths were derived from offset differences rather than the declared size. services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp OutputLayer::writeLutToHWC forwarded any non-null luts to the HWC. Crafted values could therefore make SurfaceFlinger read past the mapped region or abort.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2026 · Findings