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

Commit 10c7a55f authored by Pawan Wagh's avatar Pawan Wagh Committed by Automerger Merge Worker
Browse files

Merge "set calling UID in fuzzService" am: 5b3be151 am: 5a853510 am: 51a98f85

parents 29da4c3b 51a98f85
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <fuzzbinder/random_parcel.h>

#include <android-base/logging.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>

namespace android {
@@ -30,6 +31,11 @@ void fuzzService(const sp<IBinder>& binder, FuzzedDataProvider&& provider) {
            .extraFds = {},
    };

    if (provider.ConsumeBool()) {
        // set calling uid
        IPCThreadState::self()->restoreCallingIdentity(provider.ConsumeIntegral<int64_t>());
    }

    while (provider.remaining_bytes() > 0) {
        uint32_t code = provider.ConsumeIntegral<uint32_t>();
        uint32_t flags = provider.ConsumeIntegral<uint32_t>();