From f55c6e991f6b57e494cce942be871faf8566af3e Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Fri, 27 Mar 2026 23:51:12 +0000 Subject: [PATCH 01/10] RDKEMW-15927 ,RDKEMW-15007 : [APACA/Xione DE] rbus self-deadlock in XConf privacy mode fetch causing ~188s T2 init delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reason for change: When UserSettings sets privacy mode to DO_NOT_SHARE during boot, the rbus SET handler (t2PropertyDataSetHandler) runs synchronously on the single rbus callback thread — executing deleteAllProfiles() with pthread_join, disk I/O, and XConf client restart. The restarted XConf thread calls appendRequestParams() which uses getParameterValue(PRIVACYMODES_RFC) to fetch privacy mode. This issues rbus_get() on T2's own bus handle, requiring the same rbus callback thread that is already blocked processing the SET handler. This creates a self-deadlock with a 15s rbus timeout per attempt, compounded by XCONF_RETRY_TIMEOUT (180s), stalling T2 initialization. Cascading effect: While T2 is stalled, external callers (e.g. WPEFramework SystemServices plugin) invoking t2_event_s() block 15s each on rbus_getUint(Telemetry.OperationalStatus), delaying the dispatch thread by ~188s and blocking sendNotify() for EVT_ONSYSTEMPOWERSTATECHANGED. Fix: - xconfclient.c: Replace getParameterValue(PRIVACYMODES_RFC) with direct getPrivacyMode() call from privacycontrol library. The platform implementation (provided via meta layer bbappend) reads from a local in-memory cache (PRIVACY_STATE), with fallback to Thunder JSON-RPC (local HTTP) and persistent storage — none of which use rbus, eliminating the self-deadlock. ` - xconf-client/Makefile.am: Add privacycontrol include path and build dependency when IS_PRIVACYCONTROL_ENABLED is set. - telemetry_busmessage_sender.c: Add fast-fail file marker check (T2_COMPONENT_READY) before rbus_getUint() in isCachingRequired() to avoid 15s blocking timeout when T2 is not yet ready. Test Procedure: please refer the ticket comments Risks: Medium Signed-off-by: Thamim Razith --- .../commonlib/telemetry_busmessage_sender.c | 7 +++++ source/xconf-client/Makefile.am | 5 ++++ source/xconf-client/xconfclient.c | 26 +++++++------------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/source/commonlib/telemetry_busmessage_sender.c b/source/commonlib/telemetry_busmessage_sender.c index 3734bc6c..1e37874f 100644 --- a/source/commonlib/telemetry_busmessage_sender.c +++ b/source/commonlib/telemetry_busmessage_sender.c @@ -663,6 +663,13 @@ static bool isCachingRequired( ) return false ; } + // Fast-fail: check file marker before making rbus call to avoid blocking on timeout + if (access(T2_COMPONENT_READY, F_OK) != 0) + { + EVENT_DEBUG("T2 component not ready (marker file absent), caching event\n"); + return true; + } + // Always check for t2 is ready to accept events. Shutdown target can bring down t2 process at runtime uint32_t t2ReadyStatus; rbusError_t retVal = RBUS_ERROR_SUCCESS; diff --git a/source/xconf-client/Makefile.am b/source/xconf-client/Makefile.am index 201526b7..19830043 100644 --- a/source/xconf-client/Makefile.am +++ b/source/xconf-client/Makefile.am @@ -41,3 +41,8 @@ libxconfclient_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus -I${top_srcdir}/source/protocol/http libxconfclient_la_DEPENDENCIES = ${top_builddir}/source/ccspinterface/libccspinterface.la ${top_builddir}/source/t2parser/libt2parser.la +if IS_PRIVACYCONTROL_ENABLED +libxconfclient_la_CFLAGS += $(PRIVACYCONTROL_FLAG) +libxconfclient_la_CPPFLAGS += -I${top_srcdir}/source/privacycontrol +libxconfclient_la_DEPENDENCIES += ${top_builddir}/source/privacycontrol/libt2thunder_privacycontrol.la +endif diff --git a/source/xconf-client/xconfclient.c b/source/xconf-client/xconfclient.c index b2cc656c..212e40cb 100644 --- a/source/xconf-client/xconfclient.c +++ b/source/xconf-client/xconfclient.c @@ -42,6 +42,9 @@ #include "persistence.h" #include "telemetry2_0.h" #include "busInterface.h" +#if defined(PRIVACYMODES_CONTROL) +#include "rdkservices_privacyutils.h" +#endif #ifdef GTEST_ENABLE #define curl_easy_setopt curl_easy_setopt_mock #define curl_easy_getinfo curl_easy_getinfo_mock @@ -503,22 +506,13 @@ T2ERROR appendRequestParams(CURLU *uri) rc = curl_url_set(uri, CURLUPART_QUERY, "version=2", CURLU_APPENDQUERY); T2_CURL_APPENDREQUEST_ERROR(rc); #if defined(PRIVACYMODES_CONTROL) - if(T2ERROR_SUCCESS == getParameterValue(PRIVACYMODES_RFC, ¶mVal)) - { - memset(tempBuf, 0, MAX_URL_ARG_LEN); - snprintf(tempBuf, MAX_URL_ARG_LEN, "privacyModes=%s", paramVal); - rc = curl_url_set(uri, CURLUPART_QUERY, tempBuf, CURLU_URLENCODE | CURLU_APPENDQUERY); - T2_CURL_APPENDREQUEST_ERROR(rc); - free(paramVal); - paramVal = NULL; - } - else - { - T2Error("Failed to get Value for %s\n", PRIVACYMODES_RFC); - ret = T2ERROR_FAILURE; - goto error; - } - + getPrivacyMode(¶mVal); + memset(tempBuf, 0, MAX_URL_ARG_LEN); + snprintf(tempBuf, MAX_URL_ARG_LEN, "privacyModes=%s", paramVal); + rc = curl_url_set(uri, CURLUPART_QUERY, tempBuf, CURLU_URLENCODE | CURLU_APPENDQUERY); + T2_CURL_APPENDREQUEST_ERROR(rc); + free(paramVal); + paramVal = NULL; #endif error: if (NULL != tempBuf) From 44d4adb315b8e6f692b3642f29a2822352304992 Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 01:39:43 +0000 Subject: [PATCH 02/10] Addressed the L1 Test cases failure --- source/xconf-client/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/xconf-client/Makefile.am b/source/xconf-client/Makefile.am index 19830043..f5b08e4b 100644 --- a/source/xconf-client/Makefile.am +++ b/source/xconf-client/Makefile.am @@ -25,6 +25,8 @@ libxconfclient_la_LDFLAGS = -shared -fPIC -lcjson -lcurl if IS_LIBRDKCERTSEL_ENABLED libxconfclient_la_CFLAGS = $(LIBRDKCERTSEL_FLAG) libxconfclient_la_LDFLAGS += -lRdkCertSelector -lrdkconfig +else +libxconfclient_la_CFLAGS = endif libxconfclient_la_LIBADD = ${top_builddir}/source/t2parser/libt2parser.la ${top_builddir}/source/ccspinterface/libccspinterface.la libxconfclient_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus-1.0 \ @@ -41,6 +43,7 @@ libxconfclient_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus -I${top_srcdir}/source/protocol/http libxconfclient_la_DEPENDENCIES = ${top_builddir}/source/ccspinterface/libccspinterface.la ${top_builddir}/source/t2parser/libt2parser.la + if IS_PRIVACYCONTROL_ENABLED libxconfclient_la_CFLAGS += $(PRIVACYCONTROL_FLAG) libxconfclient_la_CPPFLAGS += -I${top_srcdir}/source/privacycontrol From 924b2a7fa76adb8c6e71542c4cd235947ae3a88c Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 04:23:54 +0000 Subject: [PATCH 03/10] RDKEMW-15927, RDKEMW-15007 : [APACA/Xione DE] Fix RBUS handler starvation and race condition on privacyModeVal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reason for change: When UserSettings sets privacy mode to DO_NOT_SHARE during boot, the rbus SET handler (t2PropertyDataSetHandler) runs synchronously on the single rbus callback thread — executing deleteAllProfiles() with pthread_join, disk I/O, and XConf client restart. The restarted XConf thread calls appendRequestParams() which uses getParameterValue(PRIVACYMODES_RFC) to fetch privacy mode. This issues rbus_get() on T2's own bus handle, requiring the same rbus callback thread that is already blocked processing the SET handler. This creates a self-deadlock with a 15s rbus timeout per attempt, compounded by XCONF_RETRY_TIMEOUT (180s), stalling T2 initialization. Additionally, privacyModeVal global pointer has no mutex protection, allowing use-after-free and NULL dereference under concurrent SET/GET operations during stress scenarios. Cascading effect: While T2 is stalled, external callers (e.g. WPEFramework SystemServices plugin) invoking t2_event_s() block 15s each on rbus_getUint(Telemetry.OperationalStatus), delaying the dispatch thread by ~188s and blocking sendNotify() for EVT_ONSYSTEMPOWERSTATECHANGED. Under concurrent privacy mode toggling, PROVIDER_NOT_RESPONDING with 26+ messages queued and dropped, telemetry events fall back to file caching. Fix: - rbusInterface.c: Add privacyModeMutex (PTHREAD_MUTEX_INITIALIZER) to serialize all reads/writes of privacyModeVal in SET and GET handlers, preventing use-after-free and NULL dereference. - rbusInterface.c: Add privacyModeCallbackWorker() detached thread. The SET handler now validates input, updates privacyModeVal under mutex, calls setPrivacyMode() for persistence, then dispatches heavy callbacks (mprofilesDeleteCallBack, privacyModesDoNotShareCallBack) to the worker thread. RBUS handler returns immediately, preventing handler thread starvation and cascading 180s timeout loops. - xconfclient.c: Replace getParameterValue(PRIVACYMODES_RFC) with direct getPrivacyMode() call from privacycontrol library. The platform implementation (provided via meta layer bbappend) reads from a local in-memory cache (PRIVACY_STATE), with fallback to Thunder JSON-RPC (local HTTP) and persistent storage — none of which use rbus, eliminating the self-deadlock. - xconf-client/Makefile.am: Add privacycontrol include path and build dependency when IS_PRIVACYCONTROL_ENABLED is set. Add else branch for libxconfclient_la_CFLAGS to define the variable in all automake conditions, fixing autoreconf failure. - telemetry_busmessage_sender.c: Add fast-fail file marker check (T2_COMPONENT_READY) before rbus_getUint() in isCachingRequired() to avoid blocking on rbus timeout when T2 is not ready. - persistence.c: Change rm -f to rm -rf in clearPersistenceFolder() non-LIBSYSWRAPPER path. PRIVACYMODE_PATH is a directory, not a file; rm -f fails silently leaving stale persistence data. Test Procedure: Concurrent stress test with multiple privacy mode toggles (SHARE/DO_NOT_SHARE via curl JSON-RPC), telemetry marker submissions (telemetry2_0_client), rbuscli reads, and SIGUSR1 signal — all running simultaneously in background. Risks: Medium Signed-off-by: Thamim Razith --- source/ccspinterface/rbusInterface.c | 72 ++++++++++++++++++++++------ source/utils/persistence.c | 2 +- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index c566005a..fd5a811a 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -61,6 +61,7 @@ static xconfPrivacyModesDoNotShareCallBack privacyModesDoNotShareCallBack; static ReportProfilesDeleteDNDCallBack mprofilesDeleteCallBack; #if defined(PRIVACYMODES_CONTROL) static char* privacyModeVal = NULL; +static pthread_mutex_t privacyModeMutex = PTHREAD_MUTEX_INITIALIZER; #endif static uint32_t t2ReadyStatus = T2_STATE_NOT_READY; static char* reportProfileVal = NULL ; @@ -379,6 +380,35 @@ rbusError_t eventSubHandler(rbusHandle_t handle, rbusEventSubAction_t action, co return RBUS_ERROR_SUCCESS; } +#if defined(PRIVACYMODES_CONTROL) +/** + * Worker thread to handle privacy mode callbacks off the RBUS handler thread. + * Prevents RBUS handler starvation by moving heavy operations (profile deletion, + * XConf restart) to a detached thread. + */ +static void* privacyModeCallbackWorker(void *arg) +{ + char* mode = (char*)arg; + T2Debug("%s ++in mode=%s\n", __FUNCTION__, mode); + + if(strcmp(mode, "DO_NOT_SHARE") == 0) + { + if(mprofilesDeleteCallBack() != T2ERROR_SUCCESS) + { + T2Error("mprofilesDeleteCallBack failed in privacy worker\n"); + } + } + if(privacyModesDoNotShareCallBack() != T2ERROR_SUCCESS) + { + T2Error("privacyModesDoNotShareCallBack failed in privacy worker\n"); + } + + free(mode); + T2Debug("%s --out\n", __FUNCTION__); + return NULL; +} +#endif + /** * Data set handler for event receiving datamodel * Data being set will be an rbusProperty object with - @@ -577,34 +607,36 @@ rbusError_t t2PropertyDataSetHandler(rbusHandle_t handle, rbusProperty_t prop, r { T2Debug("Inside datamodel handler for privacymodes profile \n"); char* data = rbusValue_ToString(paramValue_t, NULL, 0); - if(privacyModeVal != NULL) - { - free(privacyModeVal); - privacyModeVal = NULL; - } if((strcmp(data, "SHARE") != 0) && (strcmp(data, "DO_NOT_SHARE") != 0)) { T2Info("Unexpected privacy Mode value %s\n", data); free(data); return RBUS_ERROR_INVALID_INPUT; } + T2Debug("PrivacyMode data is %s\n", data); + pthread_mutex_lock(&privacyModeMutex); + if(privacyModeVal != NULL) + { + free(privacyModeVal); + privacyModeVal = NULL; + } privacyModeVal = strdup(data); - free(data); - T2Debug("PrivacyMode data is %s\n", privacyModeVal); - if(T2ERROR_SUCCESS != setPrivacyMode(privacyModeVal)) + pthread_mutex_unlock(&privacyModeMutex); + if(T2ERROR_SUCCESS != setPrivacyMode(data)) { + free(data); return RBUS_ERROR_INVALID_INPUT; } - if(strcmp(privacyModeVal, "DO_NOT_SHARE") == 0) + /* Dispatch heavy callbacks to a worker thread to avoid blocking the RBUS handler */ + pthread_t privacyWorker; + if(pthread_create(&privacyWorker, NULL, privacyModeCallbackWorker, (void*)data) == 0) { - if(mprofilesDeleteCallBack() != T2ERROR_SUCCESS) - { - return RBUS_ERROR_INVALID_INPUT; - } + pthread_detach(privacyWorker); } - if(privacyModesDoNotShareCallBack() != T2ERROR_SUCCESS) + else { - return RBUS_ERROR_INVALID_INPUT; + T2Error("Failed to create privacy mode callback worker thread\n"); + free(data); } } else @@ -751,6 +783,7 @@ rbusError_t t2PropertyDataGetHandler(rbusHandle_t handle, rbusProperty_t propert { rbusValue_t value; rbusValue_Init(&value); + pthread_mutex_lock(&privacyModeMutex); if(privacyModeVal != NULL) { rbusValue_SetString(value, privacyModeVal); @@ -758,13 +791,22 @@ rbusError_t t2PropertyDataGetHandler(rbusHandle_t handle, rbusProperty_t propert else { char *data = NULL; + pthread_mutex_unlock(&privacyModeMutex); getPrivacyMode(&data); + pthread_mutex_lock(&privacyModeMutex); if(data != NULL) { T2Debug("Privacy mode fetched from the persistent folder is %s\n", data); rbusValue_SetString(value, data); + if(privacyModeVal == NULL) + { + privacyModeVal = data; + data = NULL; + } + free(data); } } + pthread_mutex_unlock(&privacyModeMutex); rbusProperty_SetValue(property, value); rbusValue_Release(value); } diff --git a/source/utils/persistence.c b/source/utils/persistence.c index 065983fa..0332aa24 100644 --- a/source/utils/persistence.c +++ b/source/utils/persistence.c @@ -239,7 +239,7 @@ void clearPersistenceFolder(const char* path) } #else char command[256] = {'\0'}; - snprintf(command, sizeof(command), "rm -f %s*", path); + snprintf(command, sizeof(command), "rm -rf %s*", path); T2Debug("Executing command : %s\n", command); if (system(command) != 0) { From 35948d9458bd9a1f830f3154412de2cd4fde03b0 Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 17:47:39 +0000 Subject: [PATCH 04/10] Addressed the shibu review comments --- source/ccspinterface/rbusInterface.c | 5 +++++ source/commonlib/telemetry_busmessage_sender.c | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index fd5a811a..4b5604e4 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -389,6 +389,11 @@ rbusError_t eventSubHandler(rbusHandle_t handle, rbusEventSubAction_t action, co static void* privacyModeCallbackWorker(void *arg) { char* mode = (char*)arg; + if(mode == NULL) + { + T2Error("%s called with NULL arg\n", __FUNCTION__); + return NULL; + } T2Debug("%s ++in mode=%s\n", __FUNCTION__, mode); if(strcmp(mode, "DO_NOT_SHARE") == 0) diff --git a/source/commonlib/telemetry_busmessage_sender.c b/source/commonlib/telemetry_busmessage_sender.c index 1e37874f..3734bc6c 100644 --- a/source/commonlib/telemetry_busmessage_sender.c +++ b/source/commonlib/telemetry_busmessage_sender.c @@ -663,13 +663,6 @@ static bool isCachingRequired( ) return false ; } - // Fast-fail: check file marker before making rbus call to avoid blocking on timeout - if (access(T2_COMPONENT_READY, F_OK) != 0) - { - EVENT_DEBUG("T2 component not ready (marker file absent), caching event\n"); - return true; - } - // Always check for t2 is ready to accept events. Shutdown target can bring down t2 process at runtime uint32_t t2ReadyStatus; rbusError_t retVal = RBUS_ERROR_SUCCESS; From ac2299568319d9f9c39e2f00bcbc3829199f7b4d Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 18:26:25 +0000 Subject: [PATCH 05/10] Addressed the empty check on path on fetchLocalConfigs and clearPersistenceFolder --- source/utils/persistence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utils/persistence.c b/source/utils/persistence.c index 0332aa24..1f28dea2 100644 --- a/source/utils/persistence.c +++ b/source/utils/persistence.c @@ -48,7 +48,7 @@ static void persistReportMethodInit( ) T2ERROR fetchLocalConfigs(const char* path, Vector *configList) { - if(path == NULL || ((strcmp(path, SHORTLIVED_PROFILES_PATH) != 0) && configList == NULL)) + if(path == NULL || path[0] == '\0' || ((strcmp(path, SHORTLIVED_PROFILES_PATH) != 0) && configList == NULL)) { T2Error("Path is NULL or Configlist is NULL.. Invalid argument\n"); return T2ERROR_INVALID_ARGS; @@ -254,7 +254,7 @@ void clearPersistenceFolder(const char* path) void removeProfileFromDisk(const char* path, const char* fileName) { - if(path == NULL || fileName == NULL) + if(path == NULL || path[0] == '\0'|| fileName == NULL) { return; } From 902b171b14d57bdb8fd9fbd3ec7a45af89724df4 Mon Sep 17 00:00:00 2001 From: Shibu Kakkoth Vayalambron Date: Mon, 30 Mar 2026 11:36:39 -0700 Subject: [PATCH 06/10] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/ccspinterface/rbusInterface.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index 4b5604e4..a93a0ab6 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -398,14 +398,29 @@ static void* privacyModeCallbackWorker(void *arg) if(strcmp(mode, "DO_NOT_SHARE") == 0) { - if(mprofilesDeleteCallBack() != T2ERROR_SUCCESS) + if(mprofilesDeleteCallBack != NULL) { - T2Error("mprofilesDeleteCallBack failed in privacy worker\n"); + if(mprofilesDeleteCallBack() != T2ERROR_SUCCESS) + { + T2Error("mprofilesDeleteCallBack failed in privacy worker\n"); + } + } + else + { + T2Debug("mprofilesDeleteCallBack not registered, skipping profile deletion\n"); } } - if(privacyModesDoNotShareCallBack() != T2ERROR_SUCCESS) + + if(privacyModesDoNotShareCallBack != NULL) + { + if(privacyModesDoNotShareCallBack() != T2ERROR_SUCCESS) + { + T2Error("privacyModesDoNotShareCallBack failed in privacy worker\n"); + } + } + else { - T2Error("privacyModesDoNotShareCallBack failed in privacy worker\n"); + T2Debug("privacyModesDoNotShareCallBack not registered, skipping DO_NOT_SHARE handling\n"); } free(mode); From 9d4caf25c59fed53d6e5647dfce1f56526197ba1 Mon Sep 17 00:00:00 2001 From: Shibu Kakkoth Vayalambron Date: Mon, 30 Mar 2026 11:37:37 -0700 Subject: [PATCH 07/10] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/ccspinterface/rbusInterface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index a93a0ab6..83c5b428 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -627,12 +627,12 @@ rbusError_t t2PropertyDataSetHandler(rbusHandle_t handle, rbusProperty_t prop, r { T2Debug("Inside datamodel handler for privacymodes profile \n"); char* data = rbusValue_ToString(paramValue_t, NULL, 0); - if((strcmp(data, "SHARE") != 0) && (strcmp(data, "DO_NOT_SHARE") != 0)) + if(!data) { - T2Info("Unexpected privacy Mode value %s\n", data); - free(data); + T2Error("rbusValue_ToString failed for privacy mode parameter %s\n", paramName); return RBUS_ERROR_INVALID_INPUT; } + if((strcmp(data, "SHARE") != 0) && (strcmp(data, "DO_NOT_SHARE") != 0)) T2Debug("PrivacyMode data is %s\n", data); pthread_mutex_lock(&privacyModeMutex); if(privacyModeVal != NULL) From 16851fc3fcb8a64ba36848e4b1fee295d5052c01 Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 18:59:15 +0000 Subject: [PATCH 08/10] Removed the extra space for addressed the style formatting --- source/ccspinterface/rbusInterface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index 83c5b428..8c190a2b 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -428,7 +428,6 @@ static void* privacyModeCallbackWorker(void *arg) return NULL; } #endif - /** * Data set handler for event receiving datamodel * Data being set will be an rbusProperty object with - From e86b8cf14dab371adcce7b8a34dbf750341b6f2d Mon Sep 17 00:00:00 2001 From: tabbas651 Date: Mon, 30 Mar 2026 19:42:17 +0000 Subject: [PATCH 09/10] Addressed the astyle format issue --- source/ccspinterface/rbusInterface.c | 4 +++- source/utils/persistence.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index 8c190a2b..338fff67 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -632,7 +632,9 @@ rbusError_t t2PropertyDataSetHandler(rbusHandle_t handle, rbusProperty_t prop, r return RBUS_ERROR_INVALID_INPUT; } if((strcmp(data, "SHARE") != 0) && (strcmp(data, "DO_NOT_SHARE") != 0)) - T2Debug("PrivacyMode data is %s\n", data); + { + T2Debug("PrivacyMode data is %s\n", data); + } pthread_mutex_lock(&privacyModeMutex); if(privacyModeVal != NULL) { diff --git a/source/utils/persistence.c b/source/utils/persistence.c index 1f28dea2..8f990e9b 100644 --- a/source/utils/persistence.c +++ b/source/utils/persistence.c @@ -254,7 +254,7 @@ void clearPersistenceFolder(const char* path) void removeProfileFromDisk(const char* path, const char* fileName) { - if(path == NULL || path[0] == '\0'|| fileName == NULL) + if(path == NULL || path[0] == '\0' || fileName == NULL) { return; } From 30b4296c5903f70e94f91e3a141ebacb4fd9449d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:45:27 +0000 Subject: [PATCH 10/10] Fix dangling pointer in rbusInterface.c GET handler: call rbusValue_SetString after ownership transfer Agent-Logs-Url: https://github.com/rdkcentral/telemetry/sessions/d5b743ff-3289-4141-b51a-399971064c4c Co-authored-by: shibu-kv <89052442+shibu-kv@users.noreply.github.com> --- .gitignore | 4 ++++ source/ccspinterface/rbusInterface.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 942913b8..ae827539 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ source/**/Makefile source/**/Makefile.in source/**/*.deps/ source/**/.libs/ + +# Libtool wrapper scripts +source/telemetry2_0 +source/commonlib/telemetry2_0_client diff --git a/source/ccspinterface/rbusInterface.c b/source/ccspinterface/rbusInterface.c index 338fff67..ca73b723 100644 --- a/source/ccspinterface/rbusInterface.c +++ b/source/ccspinterface/rbusInterface.c @@ -818,12 +818,12 @@ rbusError_t t2PropertyDataGetHandler(rbusHandle_t handle, rbusProperty_t propert if(data != NULL) { T2Debug("Privacy mode fetched from the persistent folder is %s\n", data); - rbusValue_SetString(value, data); if(privacyModeVal == NULL) { privacyModeVal = data; data = NULL; } + rbusValue_SetString(value, privacyModeVal); free(data); } }