Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "CLA"

permissions:
contents: read
pull-requests: write
actions: write
statuses: write
Comment on lines +6 to +7

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow requests broad permissions (actions: write, statuses: write, pull-requests: write). Unless the reusable CLA workflow strictly requires all of these, reduce permissions to least privilege to limit blast radius (especially since this is also triggered by issue_comment/pull_request_target).

Suggested change
actions: write
statuses: write

Copilot uses AI. Check for mistakes.

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLA-Lite:
name: "Signature"

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow is triggered by issue_comment and pull_request_target while also passing a PAT secret (CLA_ASSISTANT) into a reusable workflow. In pull_request_target/issue_comment contexts, secrets are available even for forked PRs/comments, which increases the risk of secret exfiltration if the called workflow ever runs untrusted code or responds to attacker-controlled inputs. Consider restricting execution with a job-level if (e.g., only for PR comments, only specific comment commands, and/or only repository members) and minimizing permissions to the least required.

Suggested change
name: "Signature"
name: "Signature"
if: >-
github.event_name == 'pull_request_target' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
)
)

Copilot uses AI. Check for mistakes.
uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }}
14 changes: 12 additions & 2 deletions rdkperf/rdk_perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,30 @@ static void PerfModuleInit()
// using __attribute__((destructor))
static void PerfModuleTerminate()
{
if(s_timer != NULL) {
s_timer->StopTask();
}
Comment on lines +212 to +214

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

s_timer->StopTask() writes m_bContinue from a different thread than TimerCallback::Task() reads it, but m_bContinue is a plain bool with no synchronization. This introduces a data race (undefined behavior) on process termination. Consider making m_bContinue an std::atomic<bool> (or guarding reads/writes with the same mutex used for the condition variable) so StopTask/Task communicate safely.

Copilot uses AI. Check for mistakes.

pid_t pID = getpid();

LOG(eWarning, "RDK Performance process terminate %X\n", pID);

#if 0 // No need to print report on process exit
// Print report
RDKPerf_ReportProcess(pID);
#endif

// Remove prosess from list
RDKPerf_RemoveProcess(pID);

// Wait for timer thread cleanup
if(s_thread != NULL && s_thread->joinable()) {
LOG(eWarning, "Cleaning up timer thread\n");
s_timer->StopTask();
s_thread->join();

delete s_thread;
delete s_timer;
if(s_timer != NULL) delete s_timer;

Comment on lines 229 to +235

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

Timer resource cleanup only happens inside the if (s_thread != NULL && s_thread->joinable()) branch. If s_thread is null / not joinable but s_timer was allocated (e.g., partial init, thread already detached, or future refactor), s_timer will leak. Consider deleting s_timer (and s_thread) independently of joinable() after ensuring the worker is stopped, or handling the else path to free any allocated objects.

Copilot uses AI. Check for mistakes.
s_thread = NULL;
s_timer = NULL;
}
Expand Down
Loading