From 748523de1265abe5923b4997c77cbdca57449dae Mon Sep 17 00:00:00 2001 From: shenpeixing Date: Fri, 20 Jun 2025 14:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9tdd=E6=9C=89crash=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenpeixing --- frameworks/native/src/sensor_service_client.cpp | 1 + utils/common/src/sensor_basic_data_channel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index b6cc099c..6df7890e 100644 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -623,6 +623,7 @@ int32_t SensorServiceClient::CreateSocketChannel() CHKPR(sensorServer_, ERROR); int32_t clientFd = -1; ret = CreateSocketClientFd(clientFd); + fdsan_exchange_owner_tag(clientFd, 0, TAG); if (ret != ERR_OK || clientFd < 0) { Close(); SEN_HILOGE("Create socket channel failed, ret:%{public}d", ret); diff --git a/utils/common/src/sensor_basic_data_channel.cpp b/utils/common/src/sensor_basic_data_channel.cpp index 0c043324..2e972c84 100644 --- a/utils/common/src/sensor_basic_data_channel.cpp +++ b/utils/common/src/sensor_basic_data_channel.cpp @@ -112,6 +112,7 @@ int32_t SensorBasicDataChannel::CreateSensorBasicChannel(MessageParcel &data) return ERR_OK; } sendFd_ = data.ReadFileDescriptor(); + fdsan_exchange_owner_tag(sendFd_, 0, TAG); if (sendFd_ < 0) { SEN_HILOGE("ReadFileDescriptor is failed"); sendFd_ = -1; -- Gitee