diff options
| author | 2022-12-13 19:53:10 +0000 | |
|---|---|---|
| committer | 2022-12-13 19:53:10 +0000 | |
| commit | a1be093bae8c7b6985145f1563a268556bf12ef3 (patch) | |
| tree | 288f55f08088be1e30d4b176904f951a7aa0acc9 | |
| parent | 4ba326f84ccf4c764266a42846d840555cc617dd (diff) | |
| parent | e7c9cedab64313054a5f1d6e249a3d7118f0fe6d (diff) | |
Merge "Fix checkKeyIntentParceledCorrectly's bypass"
| -rw-r--r-- | services/core/java/com/android/server/accounts/AccountManagerService.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index a2755bec0bc0..88492edc9a73 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -3558,8 +3558,7 @@ public class AccountManagerService Bundle.setDefusable(result, true); mNumResults++; Intent intent = null; - if (result != null - && (intent = result.getParcelable(AccountManager.KEY_INTENT, android.content.Intent.class)) != null) { + if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { @@ -4928,8 +4927,10 @@ public class AccountManagerService EventLog.writeEvent(0x534e4554, "250588548", authUid, ""); return false; } - Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); + if (intent == null) { + return true; + } // Explicitly set an empty ClipData to ensure that we don't offer to // promote any Uris contained inside for granting purposes if (intent.getClipData() == null) { @@ -4979,8 +4980,12 @@ public class AccountManagerService Bundle simulateBundle = p.readBundle(); p.recycle(); Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); - return (intent.filterEquals(simulateBundle.getParcelable(AccountManager.KEY_INTENT, - Intent.class))); + Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT, + Intent.class); + if (intent == null) { + return (simulateIntent == null); + } + return intent.filterEquals(simulateIntent); } private boolean isExportedSystemActivity(ActivityInfo activityInfo) { @@ -5129,8 +5134,7 @@ public class AccountManagerService } } } - if (result != null - && (intent = result.getParcelable(AccountManager.KEY_INTENT, android.content.Intent.class)) != null) { + if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { |