DO NOT MERGE Revert "Fix vulnerability in AttributionSource due to incorrect ..."

Revert submission 21778792-sc-dev-2-attribution-source

Reason for revert: Not going into TM QPR3. Need to align this such that all versions are fixed at once.

Reverted changes: /q/submissionid:21778792-sc-dev-2-attribution-source

Change-Id: I3c499ba500e951c1863fbfd95d6ccbf8b23aead7
This commit is contained in:
Austin Borger
2023-03-29 18:25:42 +00:00
parent 2fc07deafd
commit 9858b3c345

View File

@@ -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 */