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

Commit 24cbdc49 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binder_parcel_fuzzer: remove embedded handle" am: 547b752a am: c6f1ee80

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1735008

Change-Id: I7d361b79606be34ea1cceb105cf8755a532aa03d
parents 0bd11b00 c6f1ee80
Loading
Loading
Loading
Loading
+0 −31
Original line number Original line Diff line number Diff line
@@ -148,28 +148,6 @@ std::vector<ParcelRead<::android::hardware::Parcel>> HWBINDER_PARCEL_READ_FUNCTI
        // should be null since we don't create any IPC objects
        // should be null since we don't create any IPC objects
        CHECK(data == nullptr) << data;
        CHECK(data == nullptr) << data;
    },
    },
    [] (const ::android::hardware::Parcel& p, uint8_t size) {
        FUZZ_LOG() << "about to readEmbeddedNativeHandle";
        size_t parent_buffer_handle = size & 0xf;
        size_t parent_offset = size >> 4;
        const native_handle_t* handle = nullptr;
        status_t status = p.readEmbeddedNativeHandle(parent_buffer_handle, parent_offset, &handle);
        FUZZ_LOG() << "readEmbeddedNativeHandle status: " << status << " handle: " << handle << " handle: " << handle;

        // should be null since we don't create any IPC objects
        CHECK(handle == nullptr) << handle;
    },
    [] (const ::android::hardware::Parcel& p, uint8_t size) {
        FUZZ_LOG() << "about to readNullableEmbeddedNativeHandle";
        size_t parent_buffer_handle = size & 0xf;
        size_t parent_offset = size >> 4;
        const native_handle_t* handle = nullptr;
        status_t status = p.readNullableEmbeddedNativeHandle(parent_buffer_handle, parent_offset, &handle);
        FUZZ_LOG() << "readNullableEmbeddedNativeHandle status: " << status << " handle: " << handle << " handle: " << handle;

        // should be null since we don't create any IPC objects
        CHECK(handle == nullptr) << handle;
    },
    [] (const ::android::hardware::Parcel& p, uint8_t /*data*/) {
    [] (const ::android::hardware::Parcel& p, uint8_t /*data*/) {
        FUZZ_LOG() << "about to readNativeHandleNoDup";
        FUZZ_LOG() << "about to readNativeHandleNoDup";
        const native_handle_t* handle = nullptr;
        const native_handle_t* handle = nullptr;
@@ -180,14 +158,5 @@ std::vector<ParcelRead<::android::hardware::Parcel>> HWBINDER_PARCEL_READ_FUNCTI
        CHECK(handle == nullptr) << handle;
        CHECK(handle == nullptr) << handle;
        CHECK(status != ::android::OK);
        CHECK(status != ::android::OK);
    },
    },
    [] (const ::android::hardware::Parcel& p, uint8_t /*data*/) {
        FUZZ_LOG() << "about to readNullableNativeHandleNoDup";
        const native_handle_t* handle = nullptr;
        status_t status = p.readNullableNativeHandleNoDup(&handle);
        FUZZ_LOG() << "readNullableNativeHandleNoDup status: " << status << " handle: " << handle;

        // should be null since we don't create any IPC objects
        CHECK(handle == nullptr) << handle;
    },
};
};
// clang-format on
// clang-format on