From ff17024e583b170312d82089fd358d278ce16c9a Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 19 Nov 2014 10:59:01 -0800 Subject: Fix issue with call backs from media process. All but a few lines of this is for issue #16013164, which allowed apps to do some operations as the media uid by having it call back to them to open a file. The problem here is with the tempory identity stuff in the activity manager, allowing us to make the open call as the original caller... ideally we should figure out a way to just get rid of all of that, but the solution here is actually easier (even though it doesn't look it) -- we now hand a token over to the openFile() call that it can use when doing permission checks to say "yes I would like the check to be against whoever is responsible for the open". This allows us to do the uid remapping for only this one specific set of permission checks, and nothing else. Also fix issue #17487348: Isolated services can access system services they shouldn't be able to. Don't send any system service IBinder objects down for the first initialization of an isolated process. Change-Id: I3c70e16e0899d7eef0bae458e83958b41ed2b75e --- core/java/android/app/IActivityManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/java/android/app/IActivityManager.java') diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index 6433f3f..5362303 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -219,9 +219,11 @@ public interface IActivityManager extends IInterface { public int checkPermission(String permission, int pid, int uid) throws RemoteException; - - public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId) + public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) throws RemoteException; + + public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, + IBinder callerToken) throws RemoteException; public void grantUriPermission(IApplicationThread caller, String targetPkg, Uri uri, int mode, int userId) throws RemoteException; public void revokeUriPermission(IApplicationThread caller, Uri uri, int mode, int userId) @@ -785,4 +787,5 @@ public interface IActivityManager extends IInterface { int GET_TASK_DESCRIPTION_ICON_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+238; int LAUNCH_ASSIST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+239; int START_IN_PLACE_ANIMATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+240; + int CHECK_PERMISSION_WITH_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+241; } -- cgit v1.1