From 3dee52b84d3f89a7024fd393ab3ad09110ac8732 Mon Sep 17 00:00:00 2001 From: sunxuhui Date: Wed, 18 Dec 2024 16:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=AE=8C=E5=96=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=9A=90=E7=A7=81=E5=90=88=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sunxuhui --- interfaces/inner_api/BUILD.gn | 3 +++ interfaces/kits/js/distributebundlemgr/BUILD.gn | 14 ++++++++++++++ interfaces/kits/js/distributedBundle/BUILD.gn | 14 ++++++++++++++ services/dbms/BUILD.gn | 3 +++ .../test/unittest/dbms_services_kit_test/BUILD.gn | 5 +++++ 5 files changed, 39 insertions(+) diff --git a/interfaces/inner_api/BUILD.gn b/interfaces/inner_api/BUILD.gn index d9384bc..4458b73 100644 --- a/interfaces/inner_api/BUILD.gn +++ b/interfaces/inner_api/BUILD.gn @@ -30,6 +30,9 @@ ohos_shared_library("dbms_fwk") { ubsan = true } + cflags = [ "-fstack-protector-strong" ] + cflags_cc = cflags + sources = [ "src/distributed_bms_proxy.cpp" ] defines = [ diff --git a/interfaces/kits/js/distributebundlemgr/BUILD.gn b/interfaces/kits/js/distributebundlemgr/BUILD.gn index 6604733..196b268 100644 --- a/interfaces/kits/js/distributebundlemgr/BUILD.gn +++ b/interfaces/kits/js/distributebundlemgr/BUILD.gn @@ -15,6 +15,20 @@ import("//build/ohos.gni") import("../../../../dbms.gni") ohos_shared_library("distributedbundle") { + branch_protector_ret = "pac_ret" + + sanitize = { + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + integer_overflow = true + ubsan = true + } + + cflags = [ "-fstack-protector-strong" ] + cflags_cc = cflags + include_dirs = [] defines = [ "APP_LOG_TAG = \"DistributedBundleMgrService\"", diff --git a/interfaces/kits/js/distributedBundle/BUILD.gn b/interfaces/kits/js/distributedBundle/BUILD.gn index 1c1c603..0c1964b 100644 --- a/interfaces/kits/js/distributedBundle/BUILD.gn +++ b/interfaces/kits/js/distributedBundle/BUILD.gn @@ -15,6 +15,20 @@ import("//build/ohos.gni") import("../../../../dbms.gni") ohos_shared_library("distributedbundlemanager") { + branch_protector_ret = "pac_ret" + + sanitize = { + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + integer_overflow = true + ubsan = true + } + + cflags = [ "-fstack-protector-strong" ] + cflags_cc = cflags + defines = [ "APP_LOG_TAG = \"DistributedBundleMgrService\"", "LOG_DOMAIN = 0xD0011E0", diff --git a/services/dbms/BUILD.gn b/services/dbms/BUILD.gn index d4f6a0f..6567949 100644 --- a/services/dbms/BUILD.gn +++ b/services/dbms/BUILD.gn @@ -36,6 +36,9 @@ ohos_shared_library("libdbms") { ubsan = true } + cflags = [ "-fstack-protector-strong" ] + cflags_cc = cflags + sources = [ "src/account_manager_helper.cpp", "src/dbms_device_manager.cpp", diff --git a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn index 1ee5cde..249668c 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn +++ b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn @@ -16,6 +16,11 @@ import("../../../../../dbms.gni") module_output_path = "bundle_framework/distributedbundleservice" ohos_unittest("DbmsServicesKitTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } use_exceptions = true module_out_path = module_output_path include_dirs = [ -- Gitee