From f82df571414359fd2d6765bac5247f58b380e705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Thu, 13 Mar 2025 13:44:50 +0000 Subject: [PATCH 1/7] =?UTF-8?q?cfi=20=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/engine/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/engine/BUILD.gn b/services/engine/BUILD.gn index e4569252..32f50bf2 100644 --- a/services/engine/BUILD.gn +++ b/services/engine/BUILD.gn @@ -35,6 +35,9 @@ ohos_prebuilt_etc("updater_sa.cfg") { ohos_shared_library("$updateengine_library_name") { sanitize = { boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false } shlib_type = "sa" include_dirs = sa_include_dirs -- Gitee From 718b61a34a65142b535f08fbae4e7d31dbdcb0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Fri, 14 Mar 2025 06:20:30 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/firmware/check/include/firmware_icheck.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/firmware/check/include/firmware_icheck.h b/services/firmware/check/include/firmware_icheck.h index 98b547b1..566a7cdf 100644 --- a/services/firmware/check/include/firmware_icheck.h +++ b/services/firmware/check/include/firmware_icheck.h @@ -122,15 +122,19 @@ private: { response.content.assign(buffer.begin(), buffer.end()); response.status = static_cast(HttpConstant::SUCCESS); - cJSONPtr root(cJSON_Parse(buffer.data()), cJSON_Delete); - ENGINE_CHECK(root != nullptr, return -1, "Error get root"); - cJSON *item = cJSON_GetObjectItem(root.get(), "searchStatus"); - ENGINE_CHECK(item != nullptr, return -1, "Error get searchStatus"); + // cJSONPtr root(cJSON_Parse(buffer.data()), cJSON_Delete); + cJSON *root = cJSON_Parse(buffer.data()); + ENGINE_CHECK(root != nullptr, cJSON_Delete(root);return -1, "Error get root"); + cJSON *item = cJSON_GetObjectItem(root, "searchStatus"); + ENGINE_CHECK(item != nullptr, cJSON_Delete(root);return -1, "Error get searchStatus"); if (!cJSON_IsNumber(item)) { FIRMWARE_LOGE("Error json parse"); + cJSON_Delete(root); return -1; } - return CAST_INT(static_cast(item->valueint)); + int32_t ret = item->valueint; + cJSON_Delete(root); + return ret; } int32_t ReadDataFromSSL(int32_t engineSocket, NetworkResponse &response) -- Gitee From 2517d8bc17305589f763dd862a42961196625d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Fri, 14 Mar 2025 06:35:10 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9code=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/firmware/check/include/firmware_icheck.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/firmware/check/include/firmware_icheck.h b/services/firmware/check/include/firmware_icheck.h index 566a7cdf..a53381f8 100644 --- a/services/firmware/check/include/firmware_icheck.h +++ b/services/firmware/check/include/firmware_icheck.h @@ -124,9 +124,13 @@ private: response.status = static_cast(HttpConstant::SUCCESS); // cJSONPtr root(cJSON_Parse(buffer.data()), cJSON_Delete); cJSON *root = cJSON_Parse(buffer.data()); - ENGINE_CHECK(root != nullptr, cJSON_Delete(root);return -1, "Error get root"); + ENGINE_CHECK(root != nullptr, + cJSON_Delete(root); + return -1, "Error get root"); cJSON *item = cJSON_GetObjectItem(root, "searchStatus"); - ENGINE_CHECK(item != nullptr, cJSON_Delete(root);return -1, "Error get searchStatus"); + ENGINE_CHECK(item != nullptr, + cJSON_Delete(root); + return -1, "Error get searchStatus"); if (!cJSON_IsNumber(item)) { FIRMWARE_LOGE("Error json parse"); cJSON_Delete(root); -- Gitee From 8a9c68b2631d6cd9ce38579bfe10cf5b0e5002d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Fri, 14 Mar 2025 16:02:08 +0800 Subject: [PATCH 4/7] =?UTF-8?q?cfi=20=E5=87=BD=E6=95=B0=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=20Signed-off-by:=20=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 --- services/engine/BUILD.gn | 1 + services/engine/cfi_blocklist.txt | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 services/engine/cfi_blocklist.txt diff --git a/services/engine/BUILD.gn b/services/engine/BUILD.gn index 32f50bf2..c3ae8190 100644 --- a/services/engine/BUILD.gn +++ b/services/engine/BUILD.gn @@ -38,6 +38,7 @@ ohos_shared_library("$updateengine_library_name") { cfi = true cfi_cross_dso = true debug = false + blocklist = "./cfi_blocklist.txt" } shlib_type = "sa" include_dirs = sa_include_dirs diff --git a/services/engine/cfi_blocklist.txt b/services/engine/cfi_blocklist.txt new file mode 100644 index 00000000..ea875abb --- /dev/null +++ b/services/engine/cfi_blocklist.txt @@ -0,0 +1,11 @@ +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +fun:*CheckNewVersion* -- Gitee From d580fb22613174eb1ffb5b3ef60a056c25823be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Fri, 14 Mar 2025 09:49:41 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/engine/cfi_blocklist.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/engine/cfi_blocklist.txt b/services/engine/cfi_blocklist.txt index ea875abb..c2042363 100644 --- a/services/engine/cfi_blocklist.txt +++ b/services/engine/cfi_blocklist.txt @@ -8,4 +8,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -fun:*CheckNewVersion* +[cfi] +type:*OHOS::UpdateEngine::UpdateServiceImplFirmware* -- Gitee From 33913ef2a9c07729b00d82f94b8068e392ea1e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Fri, 14 Mar 2025 11:22:26 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/engine/BUILD.gn | 1 - services/firmware/check/include/firmware_icheck.h | 1 - 2 files changed, 2 deletions(-) diff --git a/services/engine/BUILD.gn b/services/engine/BUILD.gn index c3ae8190..32f50bf2 100644 --- a/services/engine/BUILD.gn +++ b/services/engine/BUILD.gn @@ -38,7 +38,6 @@ ohos_shared_library("$updateengine_library_name") { cfi = true cfi_cross_dso = true debug = false - blocklist = "./cfi_blocklist.txt" } shlib_type = "sa" include_dirs = sa_include_dirs diff --git a/services/firmware/check/include/firmware_icheck.h b/services/firmware/check/include/firmware_icheck.h index a53381f8..706521fc 100644 --- a/services/firmware/check/include/firmware_icheck.h +++ b/services/firmware/check/include/firmware_icheck.h @@ -122,7 +122,6 @@ private: { response.content.assign(buffer.begin(), buffer.end()); response.status = static_cast(HttpConstant::SUCCESS); - // cJSONPtr root(cJSON_Parse(buffer.data()), cJSON_Delete); cJSON *root = cJSON_Parse(buffer.data()); ENGINE_CHECK(root != nullptr, cJSON_Delete(root); -- Gitee From fffe5a46574c107dea47524f766836dab942e759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Sat, 15 Mar 2025 07:05:37 +0000 Subject: [PATCH 7/7] 1111 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/engine/BUILD.gn | 2 +- services/engine/src/update_service_impl_firmware.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/services/engine/BUILD.gn b/services/engine/BUILD.gn index 32f50bf2..a62cccdb 100644 --- a/services/engine/BUILD.gn +++ b/services/engine/BUILD.gn @@ -37,7 +37,7 @@ ohos_shared_library("$updateengine_library_name") { boundary_sanitize = true cfi = true cfi_cross_dso = true - debug = false + debug = true } shlib_type = "sa" include_dirs = sa_include_dirs diff --git a/services/engine/src/update_service_impl_firmware.cpp b/services/engine/src/update_service_impl_firmware.cpp index f8e0f042..2e217a1d 100644 --- a/services/engine/src/update_service_impl_firmware.cpp +++ b/services/engine/src/update_service_impl_firmware.cpp @@ -39,14 +39,18 @@ const std::string LANGUAGE_END = ""; int32_t UpdateServiceImplFirmware::CheckNewVersion(const UpgradeInfo &info, BusinessError &businessError, CheckResult &checkResult) { + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); wptr weakPtr(this); + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); FirmwareManager::GetInstance()->DoCheck( [&, weakPtr](const BusinessError &error, const CheckResult &result) { + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); sptr firmwareSptr = weakPtr.promote(); if (firmwareSptr == nullptr) { FIRMWARE_LOGE("UpdateServiceImplFirmware has been destructed, CheckNewVersion is TimeOut"); return; } + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); businessError = error; checkResult = result; firmwareSptr->checkComplete_ = true; @@ -60,7 +64,9 @@ int32_t UpdateServiceImplFirmware::CheckNewVersion(const UpgradeInfo &info, Busi businessError.errorNum = CallResult::TIME_OUT; businessError.message = "CheckNewVersion TimeOut"; } + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); weakPtr->checkComplete_ = false; + FIRMWARE_LOGE("XXXXYYYZZ: checkNewversion"); return INT_CALL_SUCCESS; } -- Gitee