diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 9cf18edc26..a42ecc643c 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -30,10 +30,15 @@ group("fuzztest") { "cleanmission_fuzzer:fuzztest", "clearupapplicationdata_fuzzer:fuzztest", "closeability_fuzzer:fuzztest", + "completefirstframedrawing_fuzzer:fuzztest", "connectability_fuzzer:fuzztest", "continueability_fuzzer:fuzztest", "continuemission_fuzzer:fuzztest", + "delegatordoabilitybackground_fuzzer:fuzztest", + "delegatordoabilityforeground_fuzzer:fuzztest", "disconnectability_fuzzer:fuzztest", + "doabilitybackground_fuzzer:fuzztest", + "doabilityforeground_fuzzer:fuzztest", "dumpstate_fuzzer:fuzztest", "dumpsysstate_fuzzer:fuzztest", "finishusertest_fuzzer:fuzztest", @@ -43,6 +48,7 @@ group("fuzztest") { "getextensionrunninginfos_fuzzer:fuzztest", "getmissionidbytoken_fuzzer:fuzztest", "getmissioninfos_fuzzer:fuzztest", + "getmissionsnapshot_fuzzer:fuzztest", "getprocessrunninginfos_fuzzer:fuzztest", "gettopability_fuzzer:fuzztest", "getwantsender_fuzzer:fuzztest", @@ -69,7 +75,9 @@ group("fuzztest") { "schedulecommandabilitydone_fuzzer:fuzztest", "scheduleconnectabilitydone_fuzzer:fuzztest", "scheduledisconnectabilitydone_fuzzer:fuzztest", + "sendanrprocessid_fuzzer:fuzztest", "sendresulttoability_fuzzer:fuzztest", + "setabilitycontroller_fuzzer:fuzztest", "setmissionicon_fuzzer:fuzztest", "setmissionlabel_fuzzer:fuzztest", "startability_fuzzer:fuzztest", diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn b/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn new file mode 100644 index 0000000000..8ee2fcbf32 --- /dev/null +++ b/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("CompleteFirstFrameDrawingFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/completefirstframedrawing_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "completefirstframedrawing_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":CompleteFirstFrameDrawingFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.cpp b/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.cpp new file mode 100644 index 0000000000..217289c84f --- /dev/null +++ b/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "completefirstframedrawing_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; + + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); + } + + return token; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + // get token and connectCallback + sptr abilityToken = GetFuzzAbilityToken(); + if (!abilityToken) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + abilitymgr->CompleteFirstFrameDrawing(abilityToken); + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.h b/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.h new file mode 100644 index 0000000000..ac36102b1c --- /dev/null +++ b/test/fuzztest/completefirstframedrawing_fuzzer/completefirstframedrawing_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_COMPLETEFIRSTFRAMEDRAWING_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_COMPLETEFIRSTFRAMEDRAWING_FUZZER_H + +#define FUZZ_PROJECT_NAME "completefirstframedrawing_fuzzer" + +#endif diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/corpus/init b/test/fuzztest/completefirstframedrawing_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/completefirstframedrawing_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/project.xml b/test/fuzztest/completefirstframedrawing_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/completefirstframedrawing_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/delegatordoabilitybackground_fuzzer/BUILD.gn b/test/fuzztest/delegatordoabilitybackground_fuzzer/BUILD.gn new file mode 100644 index 0000000000..3337414e19 --- /dev/null +++ b/test/fuzztest/delegatordoabilitybackground_fuzzer/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("DelegatorDoAbilityBackgroundFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = "${ability_runtime_test_path}/fuzztest/delegatordoabilitybackground_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "delegatordoabilitybackground_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":DelegatorDoAbilityBackgroundFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/delegatordoabilitybackground_fuzzer/corpus/init b/test/fuzztest/delegatordoabilitybackground_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/delegatordoabilitybackground_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.cpp b/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.cpp new file mode 100644 index 0000000000..dc8c1fbc4c --- /dev/null +++ b/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "delegatordoabilitybackground_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; + + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); + } + + return token; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + // get token and connectCallback + sptr token = GetFuzzAbilityToken(); + if (!token) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + if (abilitymgr->DelegatorDoAbilityBackground(token) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.h b/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.h new file mode 100644 index 0000000000..99b2c0fccc --- /dev/null +++ b/test/fuzztest/delegatordoabilitybackground_fuzzer/delegatordoabilitybackground_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_DELEGATORDOABILITYBACKGROUND_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_DELEGATORDOABILITYBACKGROUND_FUZZER_H + +#define FUZZ_PROJECT_NAME "delegatordoabilitybackground_fuzzer" + +#endif diff --git a/test/fuzztest/delegatordoabilitybackground_fuzzer/project.xml b/test/fuzztest/delegatordoabilitybackground_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/delegatordoabilitybackground_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn b/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn new file mode 100644 index 0000000000..77e9ef9b41 --- /dev/null +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("DelegatorDoAbilityForegroundFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = "${ability_runtime_test_path}/fuzztest/delegatordoabilityforeground_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "delegatordoabilityforeground_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":DelegatorDoAbilityForegroundFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/corpus/init b/test/fuzztest/delegatordoabilityforeground_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.cpp b/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.cpp new file mode 100644 index 0000000000..dbd19fdade --- /dev/null +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "delegatordoabilityforeground_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; + + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); + } + + return token; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + // get token and connectCallback + sptr token = GetFuzzAbilityToken(); + if (!token) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + if (abilitymgr->DelegatorDoAbilityForeground(token) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.h b/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.h new file mode 100644 index 0000000000..b6acd2a7e2 --- /dev/null +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/delegatordoabilityforeground_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_DELEGATORDOABILITYFOREGROUND_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_DELEGATORDOABILITYFOREGROUND_FUZZER_H + +#define FUZZ_PROJECT_NAME "delegatordoabilityforeground_fuzzer" + +#endif diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/project.xml b/test/fuzztest/delegatordoabilityforeground_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn b/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn new file mode 100644 index 0000000000..bb5a5d94ae --- /dev/null +++ b/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("DoAbilityBackgroundFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/doabilitybackground_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "doabilitybackground_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":DoAbilityBackgroundFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/doabilitybackground_fuzzer/corpus/init b/test/fuzztest/doabilitybackground_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/doabilitybackground_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.cpp b/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.cpp new file mode 100644 index 0000000000..08ff8b3430 --- /dev/null +++ b/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "doabilitybackground_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; + + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); + } + + return token; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + // get token and connectCallback + sptr token = GetFuzzAbilityToken(); + uint32_t flag = GetU32Data(data); + if (!token) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + if (abilitymgr->DoAbilityBackground(token, flag) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.h b/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.h new file mode 100644 index 0000000000..fe654495c7 --- /dev/null +++ b/test/fuzztest/doabilitybackground_fuzzer/doabilitybackground_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_DOABILITYBACKGROUND_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_DOABILITYBACKGROUND_FUZZER_H + +#define FUZZ_PROJECT_NAME "doabilitybackground_fuzzer" + +#endif diff --git a/test/fuzztest/doabilitybackground_fuzzer/project.xml b/test/fuzztest/doabilitybackground_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/doabilitybackground_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn b/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn new file mode 100644 index 0000000000..eb93949c14 --- /dev/null +++ b/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("DoAbilityForegroundFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/doabilityforeground_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "doabilityforeground_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":DoAbilityForegroundFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/doabilityforeground_fuzzer/corpus/init b/test/fuzztest/doabilityforeground_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/doabilityforeground_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.cpp b/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.cpp new file mode 100644 index 0000000000..83911a3635 --- /dev/null +++ b/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "doabilityforeground_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; + + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); + } + + return token; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + // get token and connectCallback + sptr token = GetFuzzAbilityToken(); + uint32_t flag = GetU32Data(data); + if (!token) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + if (abilitymgr->DoAbilityForeground(token, flag) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.h b/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.h new file mode 100644 index 0000000000..2d9bb31e0b --- /dev/null +++ b/test/fuzztest/doabilityforeground_fuzzer/doabilityforeground_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_DOABILITYFOREGROUND_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_DOABILITYFOREGROUND_FUZZER_H + +#define FUZZ_PROJECT_NAME "doabilityforeground_fuzzer" + +#endif diff --git a/test/fuzztest/doabilityforeground_fuzzer/project.xml b/test/fuzztest/doabilityforeground_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/doabilityforeground_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/getmissionsnapshot_fuzzer/BUILD.gn b/test/fuzztest/getmissionsnapshot_fuzzer/BUILD.gn new file mode 100644 index 0000000000..d1ad35121b --- /dev/null +++ b/test/fuzztest/getmissionsnapshot_fuzzer/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("GetMissionSnapshotFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/getmissionsnapshot_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "getmissionsnapshot_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":GetMissionSnapshotFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/getmissionsnapshot_fuzzer/corpus/init b/test/fuzztest/getmissionsnapshot_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/getmissionsnapshot_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.cpp b/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.cpp new file mode 100644 index 0000000000..05d2b7f19e --- /dev/null +++ b/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "getmissionsnapshot_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +constexpr uint8_t ENABLE = 2; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + std::string deviceId(data, size); + int32_t missionId = static_cast(GetU32Data(data)); + MissionSnapshot snapshot; + bool isLowResolution = *data % ENABLE; + if (abilitymgr->GetMissionSnapshot(deviceId, missionId, snapshot, isLowResolution) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.h b/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.h new file mode 100644 index 0000000000..24ab3d0791 --- /dev/null +++ b/test/fuzztest/getmissionsnapshot_fuzzer/getmissionsnapshot_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_GETMISSIONSNAPSHOT_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_GETMISSIONSNAPSHOT_FUZZER_H + +#define FUZZ_PROJECT_NAME "getmissionsnapshot_fuzzer" + +#endif diff --git a/test/fuzztest/getmissionsnapshot_fuzzer/project.xml b/test/fuzztest/getmissionsnapshot_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/getmissionsnapshot_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/gettopability_fuzzer/BUILD.gn b/test/fuzztest/gettopability_fuzzer/BUILD.gn index 62ce42f978..a3936837d1 100755 --- a/test/fuzztest/gettopability_fuzzer/BUILD.gn +++ b/test/fuzztest/gettopability_fuzzer/BUILD.gn @@ -41,6 +41,7 @@ ohos_fuzztest("GetTopAbilityFuzzTest") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_services_path}/abilitymgr:abilityms", ] external_deps = [ @@ -49,6 +50,7 @@ ohos_fuzztest("GetTopAbilityFuzzTest") { "appspawn:appspawn_socket_client", "bundle_framework:appexecfwk_base", "ipc:ipc_core", + "relational_store:native_dataability", ] } diff --git a/test/fuzztest/gettopability_fuzzer/gettopability_fuzzer.cpp b/test/fuzztest/gettopability_fuzzer/gettopability_fuzzer.cpp index c7df810fb1..13bf394c66 100755 --- a/test/fuzztest/gettopability_fuzzer/gettopability_fuzzer.cpp +++ b/test/fuzztest/gettopability_fuzzer/gettopability_fuzzer.cpp @@ -19,23 +19,50 @@ #include #include "ability_manager_client.h" +#include "ability_record.h" using namespace OHOS::AAFwk; using namespace OHOS::AppExecFwk; namespace OHOS { constexpr size_t FOO_MAX_LEN = 1024; - bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) - { - AbilityManagerClient* abilityMgrClient = new AbilityManagerClient(); - if (!abilityMgrClient) { - return false; - } +sptr GetFuzzAbilityToken() +{ + sptr token = nullptr; - abilityMgrClient->GetTopAbility(); - - return true; + AbilityRequest abilityRequest; + abilityRequest.appInfo.bundleName = "com.example.fuzzTest"; + abilityRequest.abilityInfo.name = "MainAbility"; + abilityRequest.abilityInfo.type = AbilityType::DATA; + std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); + if (abilityRecord) { + token = abilityRecord->GetToken(); } + + return token; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + abilitymgr->GetTopAbility(); + + // get token and connectCallback + sptr token = GetFuzzAbilityToken(); + if (!token) { + std::cout << "Get ability token failed." << std::endl; + return false; + } + + if (abilitymgr->GetTopAbility(token) != 0) { + return false; + } + + return true; +} } /* Fuzzer entry point */ diff --git a/test/fuzztest/sendanrprocessid_fuzzer/BUILD.gn b/test/fuzztest/sendanrprocessid_fuzzer/BUILD.gn new file mode 100644 index 0000000000..eb3e6beca5 --- /dev/null +++ b/test/fuzztest/sendanrprocessid_fuzzer/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("SendANRProcessIDFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/sendanrprocessid_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "sendanrprocessid_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":SendANRProcessIDFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/sendanrprocessid_fuzzer/corpus/init b/test/fuzztest/sendanrprocessid_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/sendanrprocessid_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/sendanrprocessid_fuzzer/project.xml b/test/fuzztest/sendanrprocessid_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/sendanrprocessid_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.cpp b/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.cpp new file mode 100644 index 0000000000..8a6fcd5cf2 --- /dev/null +++ b/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "sendanrprocessid_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +} +uint32_t GetU32Data(const char* ptr) +{ + // convert fuzz input data to an integer + return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; +} +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + int pid = static_cast(GetU32Data(data)); + if (abilitymgr->SendANRProcessID(pid) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.h b/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.h new file mode 100644 index 0000000000..906c77c1b3 --- /dev/null +++ b/test/fuzztest/sendanrprocessid_fuzzer/sendanrprocessid_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_SENDANRPROCESSID_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_SENDANRPROCESSID_FUZZER_H + +#define FUZZ_PROJECT_NAME "sendanrprocessid_fuzzer" + +#endif diff --git a/test/fuzztest/setabilitycontroller_fuzzer/BUILD.gn b/test/fuzztest/setabilitycontroller_fuzzer/BUILD.gn new file mode 100644 index 0000000000..a1ab642098 --- /dev/null +++ b/test/fuzztest/setabilitycontroller_fuzzer/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/ohos.gni") +import("//build/test.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") +module_output_path = "ability_runtime/abilitymgr" + +##############################fuzztest########################################## +ohos_fuzztest("SetAbilityControllerFuzzTest") { + module_out_path = module_output_path + + fuzz_config_file = + "${ability_runtime_test_path}/fuzztest/setabilitycontroller_fuzzer" + include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include" ] + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "setabilitycontroller_fuzzer.cpp" ] + + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_services_path}/abilitymgr:abilityms", + "//third_party/jsoncpp:jsoncpp", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "eventhandler:libeventhandler", + "ipc:ipc_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "i18n:intl_util", + "window_manager:libwm", + ] + } +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [] + deps += [ + # deps file + ":SetAbilityControllerFuzzTest", + ] +} +############################################################################### diff --git a/test/fuzztest/setabilitycontroller_fuzzer/corpus/init b/test/fuzztest/setabilitycontroller_fuzzer/corpus/init new file mode 100644 index 0000000000..8eb5a7d6eb --- /dev/null +++ b/test/fuzztest/setabilitycontroller_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/setabilitycontroller_fuzzer/project.xml b/test/fuzztest/setabilitycontroller_fuzzer/project.xml new file mode 100644 index 0000000000..6e8ad2cfde --- /dev/null +++ b/test/fuzztest/setabilitycontroller_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.cpp b/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.cpp new file mode 100644 index 0000000000..84191d2e7d --- /dev/null +++ b/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 "setabilitycontroller_fuzzer.h" + +#include +#include + +#include "ability_manager_client.h" +#include "ability_record.h" +#include "iability_controller.h" + +using namespace OHOS::AAFwk; +using namespace OHOS::AppExecFwk; + +namespace OHOS { +namespace { +constexpr size_t FOO_MAX_LEN = 1024; +constexpr uint8_t ENABLE = 2; +} +class AbilityControllerFuzz : public IRemoteStub { +public: + AbilityControllerFuzz(); + virtual ~AbilityControllerFuzz(); + virtual bool AllowAbilityStart(const Want &want, const std::string &bundleName) override; + virtual bool AllowAbilityBackground(const std::string &bundleName) override; +}; +bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) +{ + auto abilitymgr = AbilityManagerClient::GetInstance(); + if (!abilitymgr) { + return false; + } + + sptr abilityController; + bool imAStabilityTest = *data % ENABLE; + if (abilitymgr->SetAbilityController(abilityController, imAStabilityTest) != 0) { + return false; + } + + return true; +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + if (data == nullptr) { + std::cout << "invalid data" << std::endl; + return 0; + } + + /* Validate the length of size */ + if (size == 0 || size > OHOS::FOO_MAX_LEN) { + std::cout << "invalid size" << std::endl; + return 0; + } + + char* ch = (char *)malloc(size + 1); + if (ch == nullptr) { + std::cout << "malloc failed." << std::endl; + return 0; + } + + (void)memset_s(ch, size + 1, 0x00, size + 1); + if (memcpy_s(ch, size, data, size) != EOK) { + std::cout << "copy failed." << std::endl; + free(ch); + ch = nullptr; + return 0; + } + + OHOS::DoSomethingInterestingWithMyAPI(ch, size); + free(ch); + ch = nullptr; + return 0; +} + diff --git a/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.h b/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.h new file mode 100644 index 0000000000..215196cf9b --- /dev/null +++ b/test/fuzztest/setabilitycontroller_fuzzer/setabilitycontroller_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef FUZZTEST_OHOS_ABILITY_RUNTIME_SETABILITYCONTROLLER_FUZZER_H +#define FUZZTEST_OHOS_ABILITY_RUNTIME_SETABILITYCONTROLLER_FUZZER_H + +#define FUZZ_PROJECT_NAME "setabilitycontroller_fuzzer" + +#endif