Merge "Revert "Fix vulnerability in AttributionSource due to incorrect ..."" into tm-dev am: bc41a6529c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21893030 Change-Id: If8e824e90d5a40313a24b93e75e8b128bdc447e8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -31,7 +31,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;
|
||||
|
||||
@@ -88,8 +87,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);
|
||||
@@ -157,20 +154,9 @@ public final class AttributionSource implements Parcelable {
|
||||
AttributionSource(@NonNull Parcel in) {
|
||||
this(AttributionSourceState.CREATOR.createFromParcel(in));
|
||||
|
||||
if (!Binder.isDirectlyHandlingTransaction()) {
|
||||
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