CVE-2025-22436 AI-generated analysis
platform/frameworks/native, SurfaceFlinger (Layer / FrontEnd layer snapshot) input window info generation for InputDispatcher occlusion detection
SurfaceFlinger now treats color-fill (dim) layers as needing input info, so they are included in the window list sent to InputDispatcher and counted in occlusion detection, closing a tapjacking gap.
Root cause
Layer::needsInputInfo() in services/surfaceflinger/Layer.h returned true only for layers that had input info or a buffer/sideband stream (and were not a potential cursor). A layer that only fills a solid color (fillsColor(), e.g. a dim layer) has no buffer, so no InputWindowHandle was generated for it. The comment on the function states these handles exist so InputDispatcher can do PID based occlusion detection. Because color layers were missing from that list, a color layer covering another window was invisible to the occlusion logic. On the Android 15 FrontEnd path, LayerSnapshotBuilder::updateInput also based the NO_INPUT_CHANNEL decision on the raw presence of requested.windowInfoHandle and overwrote inputConfig rather than OR-ing into it, and RequestedLayerState had no needsInputInfo/fillsColor notion.
How the fix works
- Android 14 (de705b880c87): services/surfaceflinger/Layer.h, Layer::needsInputInfo(): the condition becomes (hasInputInfo() || hasBufferOrSidebandStream() || fillsColor()) && !mPotentialCursor, so color-fill layers now produce an InputWindowHandle for InputDispatcher.
- Android 15 (46266c3dc67e): services/surfaceflinger/FrontEnd/RequestedLayerState.cpp/.h adds RequestedLayerState::needsInputInfo(). It returns false for potentialCursor, true if hasBufferOrSidebandStream() || fillsColor(), and otherwise true only if windowInfoHandle has a non-null token or NO_INPUT_CHANNEL set. The commit also adds the helpers hasBufferOrSidebandStream() (sidebandStream or externalTexture non-null) and fillsColor() (no buffer/sideband and color r, g, b all >= 0).
- Android 15: services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp, LayerSnapshotBuilder::updateInput(): the check `if (!requested.windowInfoHandle)` becomes `if (!requested.hasInputInfo())`, and `inputConfig = NO_INPUT_CHANNEL` becomes `inputConfig |= NO_INPUT_CHANNEL`. Layers without a real input channel are therefore marked NO_INPUT_CHANNEL without overwriting other config bits.
- Android 15: unit tests are added in LayerLifecycleManagerTest.cpp (layerWithBufferNeedsInputInfo, layerWithColorNeedsInputInfo) and LayerSnapshotTest.cpp (shouldUpdateInputWhenNoInputInfo). They assert that a layer with negative color and no buffer has no input info, and that setting a buffer or a valid color makes needsInputInfo()/hasInputInfo() true. The snapshot test also checks that NO_INPUT_CHANNEL is set.
Completeness
- Covers layers whose fillsColor() is true (solid color, no buffer or sideband stream) and that are not potential cursors. These layers now get an input window handle for occlusion detection.
- Layers that have no buffer, sideband stream, color fill or input info (e.g. a color with a negative component) still produce no input handle. The 15 tests explicitly keep this behaviour.
- Potential cursor layers remain excluded on both branches.
- The Android 14 commit patches only the legacy Layer::needsInputInfo() in Layer.h. The Android 15 commit instead patches the FrontEnd RequestedLayerState/LayerSnapshotBuilder path. The material does not show whether the 14 branch also has a FrontEnd path that would need the equivalent change.
- The Android 15 diff adds RequestedLayerState::needsInputInfo() but does not show its call site. Where it is consumed is not in the material.
Behavior changes
- Color-fill layers now appear in the InputWindowHandle list delivered to InputDispatcher (as windows without an input channel), so they are considered when calculating occlusion of windows beneath them.
- More window handles are sent when color/dim layers exist.
- Android 15 only: NO_INPUT_CHANNEL is OR-ed into inputConfig instead of replacing it, and the decision uses requested.hasInputInfo() rather than the mere presence of windowInfoHandle.
Per major
- Android 14: Fixed by de705b880c87 in android-security-14.0.0_r19: a one-line change to Layer::needsInputInfo() in services/surfaceflinger/Layer.h that adds || fillsColor(). At android-security-14.0.0_r31 the fixed line is present, with hasInputInfo() renamed to hasRequestedInputInfo() (3/4 lines of the region match).
- Android 15: Adapted fix 46266c3dc67e in android-security-15.0.0_r7: implemented on the FrontEnd path (RequestedLayerState::needsInputInfo/hasBufferOrSidebandStream/fillsColor, LayerSnapshotBuilder::updateInput) with unit tests. 6/8 lines of the patched region are present at android-security-15.0.0_r19.
- Android 16: Not listed by the bulletin (not affected per the bulletin). 1/4 lines of the patched region are present at android-security-16.0.0_r10, and the material does not explain why. The bulletin's affected list also names 17-qpr2-next, which the material does not reconcile with 16 and 17 being unlisted.
- Android 17: Not listed by the bulletin (not affected per the bulletin). 1/4 lines of the patched region are present at android-security-17.0.0_r3.
Unknowns
- Where RequestedLayerState::needsInputInfo() is called on Android 15 (the call site is not in the diff).
- Whether the Android 14 branch has a FrontEnd LayerSnapshotBuilder path that also needed the color-layer change.
- Why the bulletin lists 17-qpr2-next as affected while the per-major facts show 16 and 17 as not listed.
- Why only 1/4 lines of the patched region are present at the 16 and 17 tags.