From 250db8568b8dc9f391d4eb35099c008cc93eb1bf Mon Sep 17 00:00:00 2001 From: zhoumengjie Date: Tue, 9 Jan 2024 20:30:17 +0800 Subject: [PATCH] =?UTF-8?q?CFI=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoumengjie Change-Id: Icd089f4006b45ca8cd0cbc298d0babbe03a15163 --- libdmabufheap/BUILD.gn | 7 +++++++ libmeminfo/BUILD.gn | 7 +++++++ libpurgeablemem/BUILD.gn | 7 +++++++ libpurgeablemem/interfaces/kits/c/BUILD.gn | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/libdmabufheap/BUILD.gn b/libdmabufheap/BUILD.gn index 9dd2fcb..5a3c815 100644 --- a/libdmabufheap/BUILD.gn +++ b/libdmabufheap/BUILD.gn @@ -28,4 +28,11 @@ ohos_shared_library("libdmabufheap") { subsystem_name = "commonlibrary" innerapi_tags = [ "chipsetsdk" ] part_name = "memory_utils" + + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" } diff --git a/libmeminfo/BUILD.gn b/libmeminfo/BUILD.gn index 59b0042..783c78c 100644 --- a/libmeminfo/BUILD.gn +++ b/libmeminfo/BUILD.gn @@ -28,4 +28,11 @@ ohos_shared_library("libmeminfo") { public_configs = [ ":libmeminfo_config" ] subsystem_name = "commonlibrary" part_name = "memory_utils" + + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" } diff --git a/libpurgeablemem/BUILD.gn b/libpurgeablemem/BUILD.gn index 4480bf1..cf454b5 100644 --- a/libpurgeablemem/BUILD.gn +++ b/libpurgeablemem/BUILD.gn @@ -48,6 +48,13 @@ ohos_shared_library("libpurgeablemem") { public_configs = [ ":libpurgeable_config" ] subsystem_name = "commonlibrary" part_name = "memory_utils" + + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" } ohos_shared_library("purgeable_memory_ndk") { diff --git a/libpurgeablemem/interfaces/kits/c/BUILD.gn b/libpurgeablemem/interfaces/kits/c/BUILD.gn index 6ffd673..a9b54c1 100644 --- a/libpurgeablemem/interfaces/kits/c/BUILD.gn +++ b/libpurgeablemem/interfaces/kits/c/BUILD.gn @@ -24,4 +24,11 @@ ohos_ndk_library("libpurgeable_memory_ndk") { ndk_description_file = "./libpurgeable_memory.ndk.json" system_capability = "SystemCapability.CommonLibrary.Memory.PurgeableMemory" system_capability = "purgeable_memory/purgeable_memory.h" + + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" } -- Gitee