From 77429990bc0a232cf2e1462590b4a36898b73dfa Mon Sep 17 00:00:00 2001 From: RuiChen_01 Date: Mon, 22 Jun 2026 14:58:11 +0800 Subject: [PATCH] fix(insight_intent): fix rdbStore_ data race in BackupRdb InsightIntentRdbDataMgr::BackupRdb was the only public method that did not acquire rdbStoreMutex_ before writing the rdbStore_ shared_ptr member. Concurrent calls from other methods (InsertData / UpdateData / DeleteData* / QueryDataBeginWithKey) could race on the shared_ptr assignment, causing undefined behavior. Add the missing lock_guard. Co-Authored-By: Agent Signed-off-by: RuiChen_01 --- .../src/insight_intent/insight_intent_rdb_data_mgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp b/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp index 34594769a1..da1f716d73 100644 --- a/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp +++ b/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp @@ -315,6 +315,7 @@ bool InsightIntentRdbDataMgr::QueryAllData(std::unordered_map lock(rdbStoreMutex_); if (!IsIntentRdbLoaded()) { TAG_LOGE(AAFwkTag::INTENT, "null IntentRdbStore"); return;