CVE-2026-58962 AI-generated analysis
platform/frameworks/base, WindowManager / ActivityTaskManagerService (services/core/java/com/android/server/wm)
In ActivityTaskManagerService.moveTaskToFront, before applying caller-supplied ActivityOptions to a task being moved to the front, the fix now iterates every ActivityRecord in the task and calls options.getOptions(r) so the options' permission checks (per the commit message, display permissions) are evaluated against each activity, throwing SecurityException if any fails.
Root cause
In services/core/java/com/android/server/wm/ActivityTaskManagerService.java (the moveTaskToFront path, identified by the "moveTaskToFront" reason string passed to mTaskSupervisor.findTaskToMoveToFront), caller-supplied SafeActivityOptions were converted with options.getOptions(mTaskSupervisor) only. That overload is not tied to any specific ActivityRecord, so the per-activity checks that SafeActivityOptions performs when given an ActivityRecord (the commit message calls them display permission checks) were not run for the activities in the task being moved. A caller could therefore have options applied to a task containing activities for which it would not pass those checks.
How the fix works
- services/core/java/com/android/server/wm/ActivityTaskManagerService.java, moveTaskToFront path: the ternary `options != null ? options.getOptions(mTaskSupervisor) : null` is replaced by an explicit `if (options != null)` block.
- Inside the block, `task.forAllActivities((r) -> { options.getOptions(r); })` is called first. The return value is discarded; the call exists only for its side effect of running SafeActivityOptions' permission checks against each ActivityRecord in the task. Per the commit message, a failing check throws SecurityException, which aborts moveTaskToFront before findTaskToMoveToFront is reached.
- Only after all activities pass is `realOptions = options.getOptions(mTaskSupervisor)` computed as before and passed to mTaskSupervisor.findTaskToMoveToFront(task, flags, realOptions, "moveTaskToFront", false).
- The check runs after the existing early return that calls SafeActivityOptions.abort(options) (visible in the diff context), so the abort path is unchanged.
Completeness
- Covers only the moveTaskToFront path in ActivityTaskManagerService; no other consumer of SafeActivityOptions.getOptions(mTaskSupervisor) is modified in this commit.
- All activities in the task are checked (task.forAllActivities), not just the top one.
- The check is only performed when options != null; with null options the behavior is unchanged, which is consistent with the flaw being in option handling.
- The commit message references three bug IDs and two cherry-picked internal changes, but the public diff is a single hunk; whether the other internal change touched additional code is not shown in the material.
Behavior changes
- moveTaskToFront with non-null ActivityOptions can now throw SecurityException if any activity in the target task fails the SafeActivityOptions per-activity permission check; previously such calls proceeded.
- Additional per-activity work (one getOptions call per ActivityRecord in the task) when options are supplied; no change when options is null.
Per major
- Android 14: same fix: platform/frameworks/base 25931d579306 in android-security-14.0.0_r31, identical hunk at line 2268.
- Android 15: same fix: platform/frameworks/base c4e0cdfe07eb in android-security-15.0.0_r19, hunk at line 2283.
- Android 16: same fix: platform/frameworks/base d24c107b928d in android-security-16.0.0_r10, identical hunk at line 2343.
- Android 17: same fix: platform/frameworks/base 4c71997176db in android-security-17.0.0_r3, identical hunk at line 2482.
Unknowns
- Which specific ActivityOptions fields (e.g. launch display related) trigger the per-activity SecurityException; the SafeActivityOptions code is not included in the material.
- The content of the ActivityTaskManagerServiceTests changes named in the commit message; no test diff is provided.
- Whether the second cherry-picked internal change (2f47d65518c4) contained additional code beyond this hunk.
- How the caller's identity named in the commit message is captured, and whether it is affected by Binder identity clearing in the surrounding code; not shown in the material.