From ff53b718d11504496f3b4018e35cdb051c1780e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 18 Dec 2024 11:38:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BF=AE=E6=94=B9gn?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=8F=82=E6=95=B0=20Signed-off-by:=20?= =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foundations/BUILD.gn | 3 +++ frameworks/js/napi/update/BUILD.gn | 8 ++++++++ interfaces/inner_api/engine/BUILD.gn | 3 +++ interfaces/inner_api/modulemgr/modulemgr.gni | 3 +++ services/engine/BUILD.gn | 5 +++++ services/engine/engine_sa.gni | 3 +++ 6 files changed, 25 insertions(+) diff --git a/foundations/BUILD.gn b/foundations/BUILD.gn index 59d79794..5ff7ac78 100644 --- a/foundations/BUILD.gn +++ b/foundations/BUILD.gn @@ -46,6 +46,9 @@ ohos_shared_library("update_foundations") { "-fPIC", "-Os", "-Werror", + "-fstack-protector-strong", + "-fPIE", + "-Wl,-z,relro,-z,now", ] innerapi_tags = [ "platformsdk" ] diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index 0d7b70f1..f4a27074 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -16,6 +16,11 @@ import("../../../../updateengine.gni") import("../session/update_session.gni") ohos_shared_library("$updateengine_client_library_name") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + } sources = [] if (ability_ability_runtime_enable) { sources += [ @@ -66,5 +71,8 @@ ohos_shared_library("$updateengine_client_library_name") { "-Os", "-Werror", "-DNAPI_VERSION=8", + "-fstack-protector-strong", + "-fPIE", + "-Wl,-z,relro,-z,now", ] } diff --git a/interfaces/inner_api/engine/BUILD.gn b/interfaces/inner_api/engine/BUILD.gn index 30b88b67..7f4a42e1 100644 --- a/interfaces/inner_api/engine/BUILD.gn +++ b/interfaces/inner_api/engine/BUILD.gn @@ -86,6 +86,9 @@ ohos_shared_library("$updateengine_inner_library_name") { "-fPIC", "-Os", "-Werror", + "-fstack-protector-strong", + "-fPIE", + "-Wl,-z,relro,-z,now", ] innerapi_tags = [ "platformsdk" ] diff --git a/interfaces/inner_api/modulemgr/modulemgr.gni b/interfaces/inner_api/modulemgr/modulemgr.gni index 2540b9fc..fb70bc1a 100644 --- a/interfaces/inner_api/modulemgr/modulemgr.gni +++ b/interfaces/inner_api/modulemgr/modulemgr.gni @@ -39,4 +39,7 @@ modulemgr_cflags = [ "-fPIC", "-Os", "-Werror", + "-fstack-protector-strong", + "-fPIE", + "-Wl,-z,relro,-z,now", ] diff --git a/services/engine/BUILD.gn b/services/engine/BUILD.gn index c88b23cf..ef90d805 100644 --- a/services/engine/BUILD.gn +++ b/services/engine/BUILD.gn @@ -33,6 +33,11 @@ ohos_prebuilt_etc("updater_sa.cfg") { } ohos_shared_library("$updateengine_library_name") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + } shlib_type = "sa" include_dirs = sa_include_dirs sources = sa_sources diff --git a/services/engine/engine_sa.gni b/services/engine/engine_sa.gni index 15f808bd..c8284fdf 100644 --- a/services/engine/engine_sa.gni +++ b/services/engine/engine_sa.gni @@ -196,4 +196,7 @@ sa_cflags = [ "-fPIC", "-Os", "-Werror", + "-fstack-protector-strong", + "-fPIE", + "-Wl,-z,relro,-z,now", ] -- Gitee From 7701b181c9a4e50d407ece9257f97f98ded00a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 18 Dec 2024 03:54:18 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- frameworks/js/napi/update/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index f4a27074..ef1db521 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -16,7 +16,7 @@ import("../../../../updateengine.gni") import("../session/update_session.gni") ohos_shared_library("$updateengine_client_library_name") { - sanitize = { + sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true -- Gitee From 0ee4d4d57a033debbf04217af23c0619e029ef5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 18 Dec 2024 17:36:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20Signed-off-by:=20=E9=82=B9=E5=8F=8B?= =?UTF-8?q?=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foundations/BUILD.gn | 2 -- frameworks/js/napi/update/BUILD.gn | 2 -- interfaces/inner_api/engine/BUILD.gn | 2 -- interfaces/inner_api/modulemgr/modulemgr.gni | 2 -- services/engine/engine_sa.gni | 2 -- 5 files changed, 10 deletions(-) diff --git a/foundations/BUILD.gn b/foundations/BUILD.gn index 5ff7ac78..dd48ecee 100644 --- a/foundations/BUILD.gn +++ b/foundations/BUILD.gn @@ -47,8 +47,6 @@ ohos_shared_library("update_foundations") { "-Os", "-Werror", "-fstack-protector-strong", - "-fPIE", - "-Wl,-z,relro,-z,now", ] innerapi_tags = [ "platformsdk" ] diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index ef1db521..12084aaf 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -72,7 +72,5 @@ ohos_shared_library("$updateengine_client_library_name") { "-Werror", "-DNAPI_VERSION=8", "-fstack-protector-strong", - "-fPIE", - "-Wl,-z,relro,-z,now", ] } diff --git a/interfaces/inner_api/engine/BUILD.gn b/interfaces/inner_api/engine/BUILD.gn index 7f4a42e1..ce6b9378 100644 --- a/interfaces/inner_api/engine/BUILD.gn +++ b/interfaces/inner_api/engine/BUILD.gn @@ -87,8 +87,6 @@ ohos_shared_library("$updateengine_inner_library_name") { "-Os", "-Werror", "-fstack-protector-strong", - "-fPIE", - "-Wl,-z,relro,-z,now", ] innerapi_tags = [ "platformsdk" ] diff --git a/interfaces/inner_api/modulemgr/modulemgr.gni b/interfaces/inner_api/modulemgr/modulemgr.gni index fb70bc1a..8ba7e9f4 100644 --- a/interfaces/inner_api/modulemgr/modulemgr.gni +++ b/interfaces/inner_api/modulemgr/modulemgr.gni @@ -40,6 +40,4 @@ modulemgr_cflags = [ "-Os", "-Werror", "-fstack-protector-strong", - "-fPIE", - "-Wl,-z,relro,-z,now", ] diff --git a/services/engine/engine_sa.gni b/services/engine/engine_sa.gni index c8284fdf..517b2ce4 100644 --- a/services/engine/engine_sa.gni +++ b/services/engine/engine_sa.gni @@ -197,6 +197,4 @@ sa_cflags = [ "-Os", "-Werror", "-fstack-protector-strong", - "-fPIE", - "-Wl,-z,relro,-z,now", ] -- Gitee