diff options
author | Jeff Sharkey <jsharkey@android.com> | 2021-07-14 14:35:12 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2021-07-14 14:35:17 -0600 |
commit | 38ffbde17ee75e212f09ea5ac66859250b862a01 (patch) | |
tree | 1b2b33a76079ba4bf62d5cea39c3b737e796f521 | |
parent | ab7b0e89918d8db03830378d5520076cd0a2b970 (diff) | |
download | base-38ffbde17ee75e212f09ea5ac66859250b862a01.tar.gz |
Root UID can synthesize AttributionSource values.
We trust any incoming value from the system UID, so we should also
trust values coming from the root UID, which includes many shell
commands such as "svc".
Bug: 193659633
Test: atest BluetoothInstrumentationTests:com.android.bluetooth.btservice.AdapterServiceTest --rerun-until-failure 100
Change-Id: Ied07731345f08fc3c4df465a3773e35c8df7c59a
-rw-r--r-- | core/java/android/content/AttributionSource.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/content/AttributionSource.java b/core/java/android/content/AttributionSource.java index 0e22705146af..bdb7900b5bb9 100644 --- a/core/java/android/content/AttributionSource.java +++ b/core/java/android/content/AttributionSource.java @@ -252,7 +252,8 @@ public final class AttributionSource implements Parcelable { */ public boolean checkCallingUid() { final int callingUid = Binder.getCallingUid(); - if (callingUid != Process.SYSTEM_UID + if (callingUid != Process.ROOT_UID + && callingUid != Process.SYSTEM_UID && callingUid != mAttributionSourceState.uid) { return false; } |