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

Commit e99d8821 authored by Steven Moreland's avatar Steven Moreland
Browse files

service fuzzer: ignore interface checks

We bypass this half the time in the driver now, but
it's better to bypass it here in Parcel so that we
fuzz how different fields are set at the beginning
of Parcel.

Bug: N/A
Test: servicemanager_fuzzer for several minutes
Change-Id: I17399680c0f5d9239071e9d4fa6bcedb545f7871
parent 3a667498
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -969,14 +969,20 @@ bool Parcel::enforceInterface(const char16_t* interface,
            (!len || !memcmp(parcel_interface, interface, len * sizeof (char16_t)))) {
        return true;
    } else {
        if (!mServiceFuzzing) {
        if (mServiceFuzzing) {
            // ignore. Theoretically, this could cause a few false positives, because
            // people could assume things about getInterfaceDescriptor if they pass
            // this point, but it would be extremely fragile. It's more important that
            // we fuzz with the above things read from the Parcel.
            return true;
        } else {
            ALOGW("**** enforceInterface() expected '%s' but read '%s'",
                  String8(interface, len).string(),
                  String8(parcel_interface, parcel_interface_len).string());
        }
            return false;
        }
    }
}

void Parcel::setEnforceNoDataAvail(bool enforceNoDataAvail) {
    mEnforceNoDataAvail = enforceNoDataAvail;