diff --git a/en/device-dev/subsystems/subsys-build-module.md b/en/device-dev/subsystems/subsys-build-module.md index e3be2ad2f6460a38c256c40baf5fc4c4bca812bc..a442e71902232f76d75196b97b06d4b898c865e3 100644 --- a/en/device-dev/subsystems/subsys-build-module.md +++ b/en/device-dev/subsystems/subsys-build-module.md @@ -65,6 +65,7 @@ ohos_shared_library("helloworld") { # Sanitizer variables cfi = [boolean] + cfi_cross_dso = [boolean] # CFI: shared library support. scs = [boolean] scudo = [] ubsan = [] @@ -106,6 +107,7 @@ ohos_static_library("helloworld") { # Sanitizer variables cfi = [boolean] + cfi_cross_dso = [boolean] # CFI: shared library support. scs = [boolean] scudo = [] ubsan = [] @@ -138,6 +140,7 @@ ohos_executable("helloworld") { # Sanitizer variables cfi = [boolean] + cfi_cross_dso = [boolean] # CFI: shared library support. scs = [boolean] scudo = [] ubsan = [] @@ -181,6 +184,7 @@ ohos_source_set("helloworld") { # Sanitizer variables cfi = [boolean] + cfi_cross_dso = [boolean] # CFI: shared library support. scs = [boolean] scudo = [] ubsan = [] diff --git a/en/device-dev/subsystems/subsys-build-reference.md b/en/device-dev/subsystems/subsys-build-reference.md index 5df29a05d1f5c5c591ffe7913492f3b02f43cf5d..b18b9123625402ced8d64219b56aff6ca0019b9e 100644 --- a/en/device-dev/subsystems/subsys-build-reference.md +++ b/en/device-dev/subsystems/subsys-build-reference.md @@ -72,6 +72,7 @@ Sanitizer configuration example: ohos_shared_library("example") { sanitize = { cfi = true + cfi_cross_dso = true # CFI: shared library support. integer_overflow = true debug = true # Optional. The debug mode is disabled by default. blocklist = "./blocklist.txt" # Optional. Enter the path of the blocklist. diff --git a/zh-cn/device-dev/subsystems/subsys-build-module.md b/zh-cn/device-dev/subsystems/subsys-build-module.md index d9e2fd92a0778ae9fab621b399cca13313f8a57a..80a692a54f836cff2b0bbaaec9969a7e9bad06b9 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-module.md +++ b/zh-cn/device-dev/subsystems/subsys-build-module.md @@ -67,6 +67,7 @@ ohos_shared_library("helloworld") { sanitize = { # 各个Sanitizer开关 cfi = [boolean] # 控制流完整性检测 + cfi_cross_dso = [boolean] # 开启跨so调用的控制流完整性检测 integer_overflow = [boolean] # 整数溢出检测 boundary_sanitize = [boolean] # 边界检测 ubsan = [boolean] # 部分ubsan选项 @@ -114,6 +115,7 @@ ohos_static_library("helloworld") { sanitize = { # 各个Sanitizer开关 cfi = [boolean] # 控制流完整性检测 + cfi_cross_dso = [boolean] # 开启跨so调用的控制流完整性检测 integer_overflow = [boolean] # 整数溢出检测 boundary_sanitize = [boolean] # 边界检测 ubsan = [boolean] # 部分ubsan选项 @@ -152,6 +154,7 @@ ohos_executable("helloworld") { sanitize = { # 各个Sanitizer开关 cfi = [boolean] # 控制流完整性检测 + cfi_cross_dso = [boolean] # 开启跨so调用的控制流完整性检测 integer_overflow = [boolean] # 整数溢出检测 boundary_sanitize = [boolean] # 边界检测 ubsan = [boolean] # 部分ubsan选项 @@ -201,6 +204,7 @@ ohos_source_set("helloworld") { sanitize = { # 各个Sanitizer开关 cfi = [boolean] # 控制流完整性检测 + cfi_cross_dso = [boolean] # 开启跨so调用的控制流完整性检测 integer_overflow = [boolean] # 整数溢出检测 boundary_sanitize = [boolean] # 边界检测 ubsan = [boolean] # 部分ubsan选项 diff --git a/zh-cn/device-dev/subsystems/subsys-build-reference.md b/zh-cn/device-dev/subsystems/subsys-build-reference.md index 2a0530161bbf031a9c725a69a791ace1ec635c9a..bd1fee97a1b26f4cbd837ce200ef00302bd87a66 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-reference.md +++ b/zh-cn/device-dev/subsystems/subsys-build-reference.md @@ -69,6 +69,7 @@ ohos_shared_library("example") { sanitize = { cfi = true # 开启控制流完整性检测 + cfi_cross_dso = true # 开启跨so调用的控制流完整性检测 integer_overflow = true # 开启整数溢出检测 boundary_sanitize = true # 开启边界检测 ubsan = true # 开启部分ubsan选项 @@ -85,7 +86,7 @@ 目前支持开启的Sanitizer: - 整数溢出排错:unsigned_integer_overflow/signed_integer_overflow/integer_overflow(同时包括无符号和有符号整数溢出两种检查) -- 控制流完整性:cfi +- 控制流完整性:cfi、cfi_cross_dso(跨so的cfi检查) - 边界检测:boundary_sanitize - 部分未定义行为检测:ubsan(bool,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound等编译选项) - 全量未定义行为检测:all_ubsan(全量undefined behavior sanitizer编译选项)