CVE-2026-58951 AI-generated analysis
platform/frameworks/base, WindowManager / ActivityTaskManager (services/core/java/com/android/server/wm: AppTaskImpl, Task)
AppTaskImpl.getTaskInfo() now derives getTasksAllowed from mService.isGetTasksAllowed() for the real Binder caller instead of hardcoding true, and Task.trimIneffectiveInfo() additionally clears pictureInPictureParams, mTopActivityLocusId and taskDescription when the top activity UID differs from the task's effectiveUid.
Root cause
AppTaskImpl.getTaskInfo() called mService.getRecentTasks().createRecentTaskInfo(task, false, true), with getTasksAllowed hardcoded to true, after Binder.clearCallingIdentity(). The only gate was checkCallerOrSystemOrRoot(), which matches the uid that obtained the handle (or system/root). Any holder of an IAppTask handle that passed it therefore received a RecentTaskInfo built as if the caller had the get-tasks privilege. As a result, the top activity details of a task whose top activity belongs to a different UID than the task's effectiveUid were not trimmed. In addition, Task.trimIneffectiveInfo() only blanked the topActivity/topActivityInfo string fields and left pictureInPictureParams, mTopActivityLocusId and taskDescription intact, so even when trimming ran, those top-activity-derived fields leaked.
How the fix works
- services/core/java/com/android/server/wm/AppTaskImpl.java:getTaskInfo(): inside the mGlobalLock block and before Binder.clearCallingIdentity(), captures Binder.getCallingPid()/getCallingUid(). After the task lookup it computes getTasksAllowed = mService.isGetTasksAllowed("getTaskInfo", callingPid, callingUid) and passes that value to createRecentTaskInfo(task, false /* stripExtras */, getTasksAllowed) instead of the literal true.
- services/core/java/com/android/server/wm/Task.java:trimIneffectiveInfo(): in the existing branch guarded by task.effectiveUid != info.topActivityInfo.applicationInfo.uid, after the existing string-field stripping, adds info.pictureInPictureParams = null, info.mTopActivityLocusId = null and info.taskDescription = new ActivityManager.TaskDescription(), so these top-activity-derived fields are redacted too.
Completeness
- Covers the AppTaskImpl.getTaskInfo() entry point only. The fix relies on createRecentTaskInfo() invoking trimIneffectiveInfo() when getTasksAllowed is false, and that call site is not shown in the material.
- Redaction is added only to the top-activity branch (effectiveUid != topActivityInfo uid). The baseActivity branch (effectiveUid != baseActivityUid) still only replaces info.baseActivity with an empty ComponentName and is otherwise unchanged.
- Only three additional fields are cleared (pictureInPictureParams, mTopActivityLocusId, taskDescription). Whether other RecentTaskInfo/TaskInfo fields carry top-activity data is not visible in the material.
- Other callers of createRecentTaskInfo() are not touched by this commit. The material does not show whether any of them also hardcode getTasksAllowed.
Behavior changes
- Callers of IAppTask.getTaskInfo() that fail mService.isGetTasksAllowed() now receive a RecentTaskInfo with trimmed top-activity data when the top activity UID differs from the task's effectiveUid. Previously they got the full info.
- For trimmed tasks, pictureInPictureParams and mTopActivityLocusId become null, and taskDescription becomes an empty (non-null) ActivityManager.TaskDescription() instead of the real description.
- isGetTasksAllowed() is now invoked on every getTaskInfo() call with the tag "getTaskInfo". Any side effects it has, such as logging, are new, but its body is not in the material.
- The diff adds no new throw statements. The existing handling of a missing task (IllegalArgumentException, or a null return on Android 17) is unchanged.
Per major
- Android 14: Same fix: commit 78f37165d33f in android-security-14.0.0_r31. The hunks in AppTaskImpl.getTaskInfo() and Task.trimIneffectiveInfo() are identical, at different line offsets.
- Android 15: Same fix: commit a2ff2a8fd028 in android-security-15.0.0_r19 (the analysed commit).
- Android 16: Same fix: commit 6adabc3ac7a2 in android-security-16.0.0_r10, identical hunks at different line offsets.
- Android 17: Same fix: commit f4dc2337226e in android-security-17.0.0_r3. The added and changed lines are identical. The surrounding getTaskInfo() context differs: a missing task is logged with Slog.w and returns null instead of throwing IllegalArgumentException.
Unknowns
- The body of ActivityTaskManagerService.isGetTasksAllowed() and the exact permissions it checks are not in the material.
- The call site in RecentTasks.createRecentTaskInfo() that decides, based on getTasksAllowed, when Task.trimIneffectiveInfo() runs is not shown.
- Whether other createRecentTaskInfo() callers hardcode getTasksAllowed is not shown.
- The tests referenced (WmTests:AppTaskImplTests, WmTests:TaskTests) are not included in the diff.
- The per-major facts report 7 of 8 patched-region lines present in each latest security tag. The material does not say which line is missing or why.