DO NOT MERGE Revert "Fix vulnerability in AttributionSource due to incorrect ..." am: 9858b3c345
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22338539 Change-Id: Id0c9c95963155f4945dd50a926a78a5bd3a559e4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -30,7 +30,6 @@ import android.os.Parcelable;
|
||||
import android.os.Process;
|
||||
import android.permission.PermissionManager;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.Immutable;
|
||||
|
||||
@@ -87,8 +86,6 @@ import java.util.Set;
|
||||
*/
|
||||
@Immutable
|
||||
public final class AttributionSource implements Parcelable {
|
||||
private static final String TAG = "AttributionSource";
|
||||
|
||||
private static final String DESCRIPTOR = "android.content.AttributionSource";
|
||||
|
||||
private static final Binder sDefaultToken = new Binder(DESCRIPTOR);
|
||||
@@ -156,20 +153,9 @@ public final class AttributionSource implements Parcelable {
|
||||
AttributionSource(@NonNull Parcel in) {
|
||||
this(AttributionSourceState.CREATOR.createFromParcel(in));
|
||||
|
||||
if (!Binder.isHandlingTransaction()) {
|
||||
Log.e(TAG, "Unable to verify calling UID #" + mAttributionSourceState.uid + " PID #"
|
||||
+ mAttributionSourceState.pid + " when not handling Binder transaction; "
|
||||
+ "clearing.");
|
||||
mAttributionSourceState.pid = -1;
|
||||
mAttributionSourceState.uid = -1;
|
||||
mAttributionSourceState.packageName = null;
|
||||
mAttributionSourceState.attributionTag = null;
|
||||
mAttributionSourceState.next = null;
|
||||
} else {
|
||||
// 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
|
||||
enforceCallingUidAndPid();
|
||||
}
|
||||
// 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
|
||||
enforceCallingUidAndPid();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
|
||||
Reference in New Issue
Block a user