Merge "Fix checkKeyIntentParceledCorrectly's bypass" into rvc-dev am: 82a8fddc91 am: 7952c93b10

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20912010

Change-Id: Icc33a15a98cc818cb9f641fadbef56972b267a19
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hao Ke
2023-01-11 20:58:18 +00:00
committed by Automerger Merge Worker

View File

@@ -3513,8 +3513,7 @@ public class AccountManagerService
Bundle.setDefusable(result, true);
mNumResults++;
Intent intent = null;
if (result != null
&& (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
if (result != null) {
if (!checkKeyIntent(
Binder.getCallingUid(),
result)) {
@@ -4873,8 +4872,10 @@ public class AccountManagerService
EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
return false;
}
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
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) {
@@ -4927,7 +4928,10 @@ public class AccountManagerService
p.recycle();
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT);
return (intent.filterEquals(simulateIntent));
if (intent == null) {
return (simulateIntent == null);
}
return intent.filterEquals(simulateIntent);
}
private boolean isExportedSystemActivity(ActivityInfo activityInfo) {
@@ -5072,8 +5076,7 @@ public class AccountManagerService
}
}
}
if (result != null
&& (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
if (result != null) {
if (!checkKeyIntent(
Binder.getCallingUid(),
result)) {