Fix sysui's security issue of cross-user copy/paste
Background: The applications with the granted INTERNAL_SYSTEM_WINDOW and INTERACT_ACROSS_USERS_FULL means that it could show the same window for all of users. i.e. to use user 0 presents all of UI things to all of users. INTERNAL_SYSTEM_WINDOW usually comes with INTERACT_ACROSS_USERS_FULL because it will serve all of users to know the information that comes from framework and system server. Solution: Because SystemUI never restarts after the user changing, ClipboardService can't tell if the callingUid has the the same userId with the current user or not. The solution is to use the permission check. Especially, INTERACT_ACROSS_USERS_FULL and INTERNAL_SYSTEM_WINDOW. To check INTERACT_ACROSS_USERS_FULL by using ActivityManagerInternal.handleIncomingUser. Caution: The application with INTERNAL_SYSTEM_WINDOW usually use user 0 to show the window. But, the current user is user 10, WindowManager know the focus windows is belong to user 0 rather user 10. That's why user 10 can't copy the the text from systemui directly reply to the other applications. Readability: ClipboardService use callingUid everywhere but actaully it is not appropriated to fix this kind of bug. This patch refactor the naming to produce two name. i.e. intendingUid and intentdingUserId that are validated by ActivityManagerInternal.handleIncomingUser. Test: manual test Test: atest android.widget.cts.TextViewTest Test: atest CtsTextTestCases Test: atest CtsContentTestCases Bug: 123232892 Bug: 117768051 Change-Id: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
Loading
Please register or sign in to comment