Merge "Fix vulnerability in AttributionSource due to incorrect Binder call" into udc-dev am: 1a03b253e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21497448 Change-Id: I4f63285efed6d08d02bebfce8a6fff6e1de07290 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -155,6 +155,11 @@ public final class AttributionSource implements Parcelable {
|
|||||||
AttributionSource(@NonNull Parcel in) {
|
AttributionSource(@NonNull Parcel in) {
|
||||||
this(AttributionSourceState.CREATOR.createFromParcel(in));
|
this(AttributionSourceState.CREATOR.createFromParcel(in));
|
||||||
|
|
||||||
|
if (!Binder.isDirectlyHandlingTransaction()) {
|
||||||
|
throw new SecurityException("AttributionSource should be unparceled during a binder "
|
||||||
|
+ "transaction for proper verification.");
|
||||||
|
}
|
||||||
|
|
||||||
// Since we just unpacked this object as part of it transiting a Binder
|
// Since we just unpacked this object as part of it transiting a Binder
|
||||||
// call, this is the perfect time to enforce that its UID and PID can be trusted
|
// call, this is the perfect time to enforce that its UID and PID can be trusted
|
||||||
enforceCallingUidAndPid();
|
enforceCallingUidAndPid();
|
||||||
|
|||||||
Reference in New Issue
Block a user