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

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

Merge "Fuzz Gpu AIDL service" am: bef09848 am: 9e4cd1f7

parents 8d0da902 9e4cd1f7
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
package {
    default_applicable_licenses: ["frameworks_native_license"],
}

cc_fuzz {
    name: "gpu_service_fuzzer",
    defaults: [
        "service_fuzzer_defaults",
        "fuzzer_disable_leaks",
    ],
    static_libs: [
        "liblog",
    ],
    fuzz_config: {
        cc: [
            "paulthomson@google.com",
            "pbaiget@google.com",
        ],
        triage_assignee: "waghpawan@google.com",
    },
    include_dirs: ["frameworks/native/services/gpuservice/"],
    srcs: ["GpuServiceFuzzer.cpp"],
    shared_libs: [
        "libgpuservice",
    ],
}
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <fuzzbinder/libbinder_driver.h>

#include "GpuService.h"

using ::android::fuzzService;
using ::android::GpuService;
using ::android::sp;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    sp<GpuService> gpuService = new GpuService();
    fuzzService(gpuService, FuzzedDataProvider(data, size));
    return 0;
}