From 6511af57870adc67363664edd10fc35cf9f01128 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 26 Sep 2019 16:05:45 -0700 Subject: Remove extraneous semicolon. Bug: N/A Test: build w/o -Wno-c++98-compat-extra-semi Change-Id: I632d6df9a03485e547a6e7f14df0f1c068066c1e --- libs/binder/ProcessState.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/binder/ProcessState.cpp') diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index eb828c3ce4..0336d3ebd4 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -387,4 +387,4 @@ ProcessState::~ProcessState() mDriverFD = -1; } -}; // namespace android +} // namespace android -- cgit v1.2.3-59-g8ed1b From 24bc0d16afb20d6eb2fd073542b89c6a6c123895 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 11 Oct 2019 12:29:20 -0700 Subject: binder_parcel_fuzzer: reduce host/device differences Before, the host code had certain cases disabled b/c ProcessState abrt when /dev/binder is unavailable. However, it turns out in several placess, ProcessState is still reachable (e.g. unflattenBinder). So, instead, now, on host, the abort is just removed (and failures will happen only when host tries to invoke binder later). Bug: 142543448 Test: run binder_parcel_fuzzer for a few minutes Change-Id: I0a322d3191be3aee630f735986064d502016c05d --- libs/binder/ProcessState.cpp | 2 ++ libs/binder/fuzzer/binder.cpp | 14 ++------------ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'libs/binder/ProcessState.cpp') diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 0336d3ebd4..6971c720f3 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -373,7 +373,9 @@ ProcessState::ProcessState(const char *driver) } } +#ifdef __ANDROID__ LOG_ALWAYS_FATAL_IF(mDriverFD < 0, "Binder driver '%s' could not be opened. Terminating.", driver); +#endif } ProcessState::~ProcessState() diff --git a/libs/binder/fuzzer/binder.cpp b/libs/binder/fuzzer/binder.cpp index 86264dbe9d..04fe0e7b50 100644 --- a/libs/binder/fuzzer/binder.cpp +++ b/libs/binder/fuzzer/binder.cpp @@ -93,26 +93,16 @@ std::vector> BINDER_PARCEL_READ_FUNCTIONS { PARCEL_READ_NO_STATUS(size_t, allowFds), PARCEL_READ_NO_STATUS(size_t, hasFileDescriptors), [] (const ::android::Parcel& p, uint8_t len) { -#ifdef __ANDROID__ std::string interface(len, 'a'); FUZZ_LOG() << "about to enforceInterface: " << interface; bool b = p.enforceInterface(::android::String16(interface.c_str())); FUZZ_LOG() << "enforced interface: " << b; -#else - FUZZ_LOG() << "skipping enforceInterface"; - (void)p; - (void)len; -#endif // __ANDROID__ }, [] (const ::android::Parcel& p, uint8_t /*len*/) { -#ifdef __ANDROID__ FUZZ_LOG() << "about to checkInterface"; - bool b = p.checkInterface(new android::BBinder()); + android::sp aBinder = new android::BBinder(); + bool b = p.checkInterface(aBinder.get()); FUZZ_LOG() << "checked interface: " << b; -#else - FUZZ_LOG() << "skipping checkInterface"; - (void)p; -#endif // __ANDROID__ }, PARCEL_READ_NO_STATUS(size_t, objectsCount), PARCEL_READ_NO_STATUS(status_t, errorCheck), -- cgit v1.2.3-59-g8ed1b