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
This commit is contained in:
Jeff Sharkey
2021-07-14 14:35:12 -06:00
parent ab7b0e8991
commit 38ffbde17e

View File

@@ -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;
}