Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38ffbde1 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

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
parent ab7b0e89
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -252,7 +252,8 @@ public final class AttributionSource implements Parcelable {
     */
     */
    public boolean checkCallingUid() {
    public boolean checkCallingUid() {
        final int callingUid = Binder.getCallingUid();
        final int callingUid = Binder.getCallingUid();
        if (callingUid != Process.SYSTEM_UID
        if (callingUid != Process.ROOT_UID
                && callingUid != Process.SYSTEM_UID
                && callingUid != mAttributionSourceState.uid) {
                && callingUid != mAttributionSourceState.uid) {
            return false;
            return false;
        }
        }