Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDK-55945 : sync codebase with stable2 #16

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

shivabhaskar
Copy link
Contributor

No description provided.

@shivabhaskar shivabhaskar requested a review from a team as a code owner February 11, 2025 19:09
@rdkcmf-jenkins
Copy link

Coverity Issue - Data race condition

Accessing "compTr181ParamMap" without holding lock "compParamMap". Elsewhere, "compTr181ParamMap" is written to with "compParamMap" held 3 out of 3 times.

Medium Impact, CWE-366
MISSING_LOCK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/ccspinterface/rbusInterface.c:618

@rdkcmf-jenkins
Copy link

Coverity Issue - Data race condition

Accessing "compTr181ParamMap" without holding lock "compParamMap". Elsewhere, "compTr181ParamMap" is written to with "compParamMap" held 3 out of 3 times.

Medium Impact, CWE-366
MISSING_LOCK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/ccspinterface/rbusInterface.c:1120

@@ -565,9 +564,11 @@
T2Info("Waiting for CollectAndReport to be complete : %s\n", singleProfile->name);
pthread_mutex_lock(&plMutex);
initialized=false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Check of thread-shared field evades lock acquisition

Thread1 sets "initialized" to a new value. Now the two threads have an inconsistent view of "initialized" and updates to fields correlated with "initialized" may be lost.

High Impact, CWE-543
LOCK_EVASION

How to fix

Guard the modification of "initialized" and the read used to decide whether to modify "initialized" with the same set of locks.

if(count++ > 30){
break;
}
sleep(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Waiting while holding a lock

Call to "sleep" might sleep while holding lock "scMutex".

Medium Impact, CWE-667
SLEEP

@@ -1132,6 +1148,8 @@
T2Debug("Freeing compTr181ParamMap \n");
hash_map_destroy(compTr181ParamMap, freeComponentEventList);
compTr181ParamMap = NULL;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Check of thread-shared field evades lock acquisition

Thread1 sets "compTr181ParamMap" to a new value. Now the two threads have an inconsistent view of "compTr181ParamMap" and updates to fields of "compTr181ParamMap" or fields correlated with "compTr181ParamMap" may be lost.

High Impact, CWE-543
LOCK_EVASION

How to fix

Guard the modification of "compTr181ParamMap" and the read used to decide whether to modify "compTr181ParamMap" with the same set of locks.

strvalue[strlen(strvalue)-1] = '\0';
}
ret = report_or_cache_data(strvalue, marker);
if(strvalue != NULL){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Dereference before null check

Null-checking "strvalue" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Medium Impact, CWE-476
REVERSE_INULL

if(mutex_return != 0){
T2Error("tProfile Mutex locking failed : %d \n",mutex_return);
if(mutex_return == EBUSY)
T2Error("tProfile Mutex is Busy, already the report generation might be in progress \n");
return T2ERROR_FAILURE;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Missing unlock

Returning without unlocking "scMutex".

Medium Impact, CWE-667
LOCK

@CLAassistant
Copy link

CLAassistant commented Feb 18, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Reason for change: bring stable2 code changes to develop
Test Procedure: No Regressions
Risks: Low
Signed-off-by: c.shivabhaskar97@gmail.com
Reason for change: Fix Build Issue
Test Procedure: L1/L2 test and no change in functionality
Risks: Low
Signed-off-by: c.shivabhaskar97@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants