diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 9c3fbdd3c97bac5f2c195a3b3a75a36bdda8bc82..e112dce90b5929051132f39dd77373782903cd0d 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -26,6 +26,16 @@ file_common_src = [ ] ohos_shared_library("fileio") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -103,6 +113,16 @@ ohos_shared_library("fileio") { } ohos_shared_library("fs") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -158,6 +178,16 @@ ohos_shared_library("fs") { ] if (!use_mingw_win && !use_mac) { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + include_dirs += [ "${file_api_path}/interfaces/kits/rust/include" ] sources += [ "src/mod_fs/class_randomaccessfile/randomaccessfile_n_exporter.cpp", @@ -203,6 +233,16 @@ ohos_shared_library("fs") { } ohos_shared_library("hash") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -232,6 +272,16 @@ ohos_shared_library("hash") { } ohos_shared_library("file") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -266,6 +316,16 @@ ohos_shared_library("file") { } ohos_shared_library("statfs") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -288,6 +348,16 @@ ohos_shared_library("statfs") { } ohos_shared_library("statvfs") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -310,6 +380,16 @@ ohos_shared_library("statvfs") { } ohos_shared_library("environment") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -333,6 +413,16 @@ ohos_shared_library("environment") { ] } ohos_shared_library("userdirectory") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -358,6 +448,16 @@ ohos_shared_library("userdirectory") { ] } ohos_shared_library("securitylabel") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" @@ -384,6 +484,16 @@ ohos_shared_library("securitylabel") { } ohos_shared_library("document") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + subsystem_name = "filemanagement" part_name = "file_api" diff --git a/interfaces/kits/native/BUILD.gn b/interfaces/kits/native/BUILD.gn index 16851a1603243b5f3ae74fa85eb2883ceacf6c0d..13350d7096b7c8234ea10aa57a5e732846dc8a12 100644 --- a/interfaces/kits/native/BUILD.gn +++ b/interfaces/kits/native/BUILD.gn @@ -23,6 +23,16 @@ config("remote_uri_config") { } ohos_shared_library("remote_uri_native") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "remote_uri/remote_uri.cpp" ] public_configs = [ ":remote_uri_config" ] diff --git a/utils/filemgmt_libhilog/BUILD.gn b/utils/filemgmt_libhilog/BUILD.gn index e5dc1d3a7b3191d0c7578d7f773d0b5b24636c68..cbc0b647128e32c7c833a5a6c11f3d4607c9fa7c 100644 --- a/utils/filemgmt_libhilog/BUILD.gn +++ b/utils/filemgmt_libhilog/BUILD.gn @@ -21,6 +21,16 @@ config("log_public_config") { } ohos_shared_library("filemgmt_libhilog") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + public_configs = [ ":log_public_config" ] external_deps = [ "hilog:libhilog" ] diff --git a/utils/filemgmt_libn/BUILD.gn b/utils/filemgmt_libn/BUILD.gn index 6ebeaa444d0a8e7ed652b1f7213ea7d07f006537..48abecb650ee95ebb4ce6d1108f7bc79474d1944 100644 --- a/utils/filemgmt_libn/BUILD.gn +++ b/utils/filemgmt_libn/BUILD.gn @@ -25,6 +25,16 @@ config("libn_public_config") { } ohos_shared_library("filemgmt_libn") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "src/n_async/n_async_work_callback.cpp", "src/n_async/n_async_work_promise.cpp",