VTS sysfuzzer supports nested HAL APIs
e.g., GPS HAL's 1st-lv api is a function which returns a set of function
pointers. Thus the fuzzer needs to parse the return value of that
function and recognizes the api of the returned function pointers.
For that purpose, we use HAL_SUBMODULE interface specification.
Bug: 28440320
Change-Id: I86cef98c3c7306a1dbafa5068e4d8e0027c6f1c1
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
index 281f924..58f0129 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
@@ -44,7 +44,7 @@
bool FuzzerBase::Fuzz(const vts::InterfaceSpecificationMessage& message,
- void* result) {
+ void** result) {
cout << "Fuzzing target component: "
<< "class " << message.component_class()
<< " type " << message.component_type()
@@ -58,5 +58,6 @@
return true;
}
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.h b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
index 8687057..b14cb14 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.h
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
@@ -38,17 +38,17 @@
// Fuzz tests the loaded component using the provided interface specification.
// Returns true iff the testing is conducted completely.
- bool Fuzz(const vts::InterfaceSpecificationMessage& message, void* result);
+ bool Fuzz(const vts::InterfaceSpecificationMessage& message, void** result);
- protected:
// Actual implementation of routines to test a specific function using the
// provided function interface specification message.
// Returns true iff the testing is conducted completely.
virtual bool Fuzz(const vts::FunctionSpecificationMessage& func_msg,
- void* result) {
+ void** result) {
return false;
};
+ protected:
// a pointer to a HAL data structure of the loaded component.
struct hw_device_t* device_;