Skip to content

Rebase feature/RDKEMW-8178 branch inline with develop - #434

Open
KTirumalaSrihari wants to merge 295 commits into
feature/RDKEMW-8178from
develop
Open

KTirumalaSrihari wants to merge 295 commits into
feature/RDKEMW-8178from
develop

Conversation

@KTirumalaSrihari

Copy link
Copy Markdown
Contributor

No description provided.

naveenkumarhanasi and others added 30 commits October 24, 2025 21:54
Sysint release 3.0.8 version
Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Bringing in changes made for: RDKEMW-9493,RDKEMW-9440,RDKEMW-4148

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Co-authored-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
(cherry picked from commit 70f8618)

Co-authored-by: Aravindan NC <35158113+AravindanNC@users.noreply.github.com>
NM based connectivity check and Bug fixes
Reason for change: Optimize AuthService and DeviceProvisioning for RDK-E Stack
Test Procedure: regular build test with FSR and provisioning
Implements: sysint update
Risks: No
Source: COMCAST
License: Apache-2.0
Upstream-Status: Pending

(cherry picked from commit 784f5ce)

Signed-off-by: Sergiy Gladkyy <sgladkyy@productengine.com>
Co-authored-by: Sivasubramanian Patchaiperumal <sivasubramanian.patchaiperumal@ltts.com>
Co-authored-by: rwarier <84991591+rwarier@users.noreply.github.com>
Co-authored-by: rajkumar154 <37654540+rajkumar154@users.noreply.github.com>
Co-authored-by: nhanasi <navihansi@gmail.com>
)

* Revert "WNCXIONE-530: Synching changes from support/2.2.0 branch. (#350)"

This reverts commit 79609a1.

* Delete systemd_units/NetworkManager_ecfs.conf

---------

Co-authored-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
#355)…" (#366)

This reverts commit 21529fb.

Co-authored-by: nhanasi <navihansi@gmail.com>
RDKEMW-10335 : Cleanup of xre-receiver code
Reason for change: CPESP-3386 Remove UI Components / Recipes from OEM Yocto Layer
Test Procedure: Boot the TV and check the rootfs for xre-receiver
Risks: low

Signed-off-by: vrenu2018 <Renuka_Varry@comcast.com>
Co-authored-by: vrenu2018 <Renuka_Varry@comcast.com>
…onitoring And Logging (#376)

RDKEMW-10930: Added logging for available swap memory information to messages.txt. Included separate notifications for cached, total, and free swap memory.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate findings affect packaging, runtime behavior, reboot compatibility, and release integrity.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (17)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/component-release-workflow-usage.md:92

  • The workflow creates the approvable release PR against main, but this prerequisite says to enforce review rules on develop. That leaves the actual release PR without the documented protection and can prevent the approval flow from being governed as intended; this should refer to main.

.github/workflows/component-release-finish-on-approval.yml:108

  • The approval workflow has the same partial-release failure mode: main may be pushed successfully before the tag or develop push fails, while the later cleanup/PR-close flow does not roll back main. Use one atomic ref update for the release branches and tag, or provide recovery before treating the PR as finished.
          git push origin main
          git push origin --tags
          git push origin develop

.github/workflows/component-release.yml:128

  • The three independent pushes can leave a partial release: if the tag or develop push fails after main succeeds, cleanup only removes the tag/branch and cannot roll back the merged main. A retry can then operate on an inconsistent release state. Push the release refs atomically (or add explicit recovery for partial pushes).
          git push origin main
          git push origin --tags
          git push origin develop

lib/rdk/NM_Bootstrap.sh:42

  • The hex-SSID regex is not anchored to the complete value, so an unquoted SSID such as Face or 12foo can be treated as a partial hex string and converted/truncated. Require the entire RHS to be a valid even-length hex value before decoding, otherwise preserve it as a literal SSID.
  elif [[ "$SSID_LINE" =~ ssid=([a-fA-F0-9]+) ]]; then
      HEX_SSID="${BASH_REMATCH[1]}"
      SSID=$(printf '%b' "$(printf '%s' "$HEX_SSID" | sed 's/../\\x&/g')")

lib/rdk/alertSystem.sh:106

  • MSG_DATA and the other fields are interpolated directly into strjson without JSON escaping. An alert containing a quote, backslash, or newline produces malformed JSON, so valid alert messages can be rejected by the endpoint. Build the payload with a JSON serializer or escape each value before assembling the request.
if [ "x$PROCESS_NAME" == "xdeepSleepMgrMain" ]; then
    # Message data is actual metadata header in case of trigger from deepSleep manager process
    # This change is needed since there are data clouds in different deployment which are not flexible to accomodate any deviations in data format
    strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
    strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"

lib/rdk/core_shell.sh:340

  • These deletions remove the only in-repo implementation of /rebootNow.sh, but existing callers still execute that path (utils.sh, warehouse-reset.sh, factory-reset.sh, restore, and userInitiatedFWDnld.sh), and the Makefile still stages a symlink to the deleted script. Adding rebootnow to the core-dump list does not provide a replacement, so those reboot requests will fail. Update all callers and package the replacement binary/wrapper together.
    [ "$1" = "civetweb-worker" ] || [ "$1" = "nfrtool" ] || [ "$1" = "rdm" ] ||
    [ "$1" = "dcmd" ] || [ "$1" = "logupload" ] || [ "$1" = "backup_logs" ] ||
    [ "$1" = "update-prev-reboot-info" ] || [ "$1" = "rebootnow" ] ||
    [ "$1" = "OCDM_WVMediaKey" ] || [ "$1" = "OCDM_SaThread" ] || [ "$1" = "multiqueue28:sr" ]; then

lib/rdk/getDeviceDetails.sh:286

  • When BLUETOOTH_ENABLED is false, readBTAddress-generic.sh emits nothing, so this unconditional invocation overwrites the 00:00:00:00:00:00 default with an empty value. The previous implementation preserved the default when Bluetooth was disabled; keep the vendor/generic lookup behind the Bluetooth-enabled check.
    if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
        bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
    else
        bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`
    fi

lib/rdk/readBTAddress-generic.sh:28

  • When Bluetooth is disabled, this branch never assigns bluetooth_mac, so the script prints an empty value. getDeviceDetails.sh captures that output and overwrites its 00:00:00:00:00:00 default, regressing the documented/default Bluetooth address. Initialize the variable to the default before the conditional.
    lib/rdk/rebootNow.sh:1
  • Deleting this script leaves the Makefile's /rebootNow.sh staging symlink dangling (Makefile:86), while multiple in-tree callers still invoke /rebootNow.sh (for example factory-reset.sh, warehouse-reset.sh, and restore). Without a replacement installed at that path, those reboot flows fail; retain a compatibility implementation or update the packaging and every caller together.
    lib/rdk/rebootSTB.sh:1
  • This deletion also leaves the Makefile's /rebootSTB.sh staging symlink dangling (Makefile:85). Even though the scheduled unit is removed here, the package still advertises a path to a file that no longer exists; remove/update that packaging entry or provide the replacement before merging.
    lib/rdk/startStunnel.sh:160
  • mktemp -u only selects a pathname; it does not reserve it. A local process can create or replace $PIPE between this call and mkfifo/exec, causing the root process to open an attacker-controlled path and write the evaluated passcode to it. Create a private temporary directory (for example with mktemp -d) and create the FIFO inside it, or otherwise use an atomic, exclusive creation pattern.
    lib/rdk/startStunnel.sh:176
  • Both FIFO setup failures are logged but ignored: after mkfifo or exec ...<>$PIPE fails, execution still removes the path, backgrounds echo ... >&$FD_NUMBER, and starts stunnel. This can leave the passcode unwritten and report a misleading stunnel failure (or emit a bad-FD error); abort this setup and clean up instead of continuing when either operation fails.
    lib/rdk/startStunnel.sh:115
  • This writes checkHost=$JUMP_FQDN, and the TEST/production branches immediately write a second checkHost option at lines 123/127. Duplicate singleton options make the generated stunnel configuration ambiguous and can cause stunnel to reject it; select the host first and emit one checkHost line, retaining the jump FQDN only for the unknown-device fallback.
    lib/rdk/start_ssh.sh:77
  • This compares the literal string BUILD_TYPE rather than the variable, so the condition is always true and dev builds never take the intended dev-build branch; they instead query DeviceType and may select production keys. Compare the variable itself.
    lib/rdk/temperature-telemetry.sh:25
  • The existing togglePower helper invokes /QueryPowerState (lib/rdk/togglePower:23), but this change hard-codes /usr/bin/QueryPowerState. On images where the deployed binary is at /QueryPowerState, this command fails, leaves powerState empty, and the script still reads the thermal zone during deepsleep—the behavior this guard is meant to prevent. Use the deployed path or an explicit fallback.
    lib/rdk/timesyncd-conf-update.sh:89
  • The new retry/fallback logic is unreachable in this component: restart-timesyncd.service and its .path unit were removed, and rg finds no other caller of this script. Consequently partner/bootstrap NTP values are never applied to timesyncd.conf. Restore a trigger for this script or remove the change if time-sync configuration is now handled elsewhere.
    systemd_units/notify-network-ready.service:7
  • Touching the readiness flag in ExecStartPre makes network-up.path trigger before logMilestone.sh succeeds; if ExecStart fails, the system is still marked network-ready. Move this to ExecStartPost so the marker is created only after a successful service command.
  • Files reviewed: 65/65 changed files
  • Comments generated: 7
  • Review effort level: Lite

Comment on lines +205 to +211
hotfix_branch="hotfix/${RELEASE_VERSION}"
if git show-ref --verify --quiet "refs/heads/${hotfix_branch}"; then
git checkout "${hotfix_branch}"
else
git checkout -b "${hotfix_branch}" "${SOURCE_BRANCH}"
echo "CREATED_HOTFIX_BRANCH=true" >> "$GITHUB_ENV"
fi
Comment thread etc/10-unmanaged-devices
Comment on lines 1 to +2
[keyfile]
unmanaged-devices=interface-name:ap*;interface-name:dobby*;interface-name:lo;interface-name:p2p*;interface-name:veth*;interface-name:ip*;interface-name:wlan1
unmanaged-devices=interface-name:ap*;interface-name:dobby*;interface-name:lo;interface-name:p2p*;interface-name:veth*;interface-name:ip*;interface-name:wlan1;interface-name:wl0.2
logUploadLog "Application triggered on demand log upload"
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>/dev/null
logUploadLog "Executing logupload binary: $LOG_UPLOAD_BIN_PATH"
"$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" >> /opt/logs/dcmscript.log
Comment thread lib/rdk/startStunnel.sh
Comment on lines +196 to +199
if [ $? -ne 0 ]; then
echo_t "STUNNEL: ERROR - Failed to start stunnel process."
exit 1
fi
Comment thread lib/rdk/startStunnel.sh
Comment on lines +217 to +219
rm -f $STUNNEL_PID_FILE
rm -f $CA_FILE
if [ "x$CRED_INDEX" == "x0" ]; then
Comment on lines +1 to +9
[Unit]
Description= NetworkManager Path for bootType check

[Path]
PathExists=/tmp/bootType
Unit=NetworkManager.service

[Install]
WantedBy=multi-user.target
Comment on lines +1 to +3
[Unit]
After=securemount.service bootversion-loader.service
Wants=bootversion-loader.service

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate findings affect release security, packaging, reboot paths, and connectivity behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (16)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/component-release-workflow-usage.md:92

  • The approvable flow creates a PR from release/<version> to main and the finish workflow explicitly filters base.ref == 'main'; review rules on develop therefore do not gate this approval flow. Update the prerequisite to require review protection on main.

.github/workflows/component-release.yml:129

  • The release finish deletes the local release branch before these pushes. If any push fails after git flow release finish (for example, develop is rejected), the failure cleanup checks for that local branch and will not delete the already-published remote release/<version> branch, leaving stale release state behind. Track the published remote ref or clean it up based on the creation flag without requiring the local branch.
          git flow release publish "${RELEASE_VERSION}"
          git flow release finish -m "${RELEASE_VERSION} release" "${RELEASE_VERSION}"
          echo "CREATED_TAG=true" >> "$GITHUB_ENV"
          git push origin main
          git push origin --tags
          git push origin develop
          git push origin --delete "release/${RELEASE_VERSION}" || true

lib/rdk/alertSystem.sh:106

  • These payloads interpolate PROCESS_NAME, MSG_DATA, partnerId, and other fields directly into JSON without escaping. Alert messages containing quotes, backslashes, or newlines produce invalid JSON, and a shell-evaluated curl helper can also interpret those characters as command syntax. Serialize/JSON-escape every field before constructing strjson.
    strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
    strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"

lib/rdk/core_shell.sh:339

  • The shell reboot implementation was removed, but this change still leaves the package's reboot entry point unresolved: Makefile:85-86 creates /rebootNow.sh as a symlink to the deleted /lib/rdk/rebootNow.sh, and callers such as lib/rdk/utils.sh:65 and warehouse-reset.sh invoke /rebootNow.sh. Those reboot paths will fail unless a replacement is installed at the same path and all callers/package-install logic are updated.
    [ "$1" = "update-prev-reboot-info" ] || [ "$1" = "rebootnow" ] ||

lib/rdk/getDeviceDetails.sh:285

  • When BLUETOOTH_ENABLED is not true, the generic helper leaves bluetooth_mac unset and echoes an empty string; this assignment overwrites the function's existing all-zero default. Device details will therefore report an empty Bluetooth MAC on Bluetooth-disabled devices. Guard the helper calls with BLUETOOTH_ENABLED or preserve the default on empty output.
    if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
        bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
    else
        bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`

lib/rdk/readBTAddress-generic.sh:31

  • When BLUETOOTH_ENABLED is false, this branch never assigns bluetooth_mac, so the final echo returns an empty value. getDeviceDetails.sh now always delegates to this script, whereas it previously preserved 00:00:00:00:00:00 for disabled Bluetooth; initialize the default before the conditional.
    lib/rdk/rebootNow.sh:1
  • Deleting this script leaves existing reboot paths invoking /rebootNow.sh (for example factory-reset.sh, warehouse-reset.sh, restore, userInitiatedFWDnld.sh, and utils.sh) with no replacement, while the Makefile still installs a symlink to this deleted source. Those flows will fail at reboot time; update all callers and install packaging to the replacement binary before removing this file.
    lib/rdk/rebootSTB.sh:1
  • This deletion leaves the Makefile's /rebootSTB.sh install symlink dangling. The generated package will therefore contain a path that cannot be executed; remove/update that install rule together with any replacement for the scheduled reboot flow.
    lib/rdk/startLinkLocal.sh:55
  • The script logs Started avahi-autoipd and exits successfully without checking whether the daemon command succeeded. A missing binary, invalid interface, or daemon startup failure is therefore reported as a successful link-local start; check the command status and return nonzero on failure.
    lib/rdk/startStunnel.sh:164
  • If mkfifo fails, this only logs and continues; the subsequent open, removal, and passcode write still attempt to use a nonexistent pipe, so passcode delivery fails while stunnel proceeds. Treat FIFO creation/open failure as fatal and clean up before continuing.
    lib/rdk/startStunnel.sh:115
  • This unconditional checkHost is followed by another checkHost in each TEST/PROD branch below. That produces duplicate stunnel options for the normal device-type path (and can make stunnel reject the configuration or select the wrong hostname); emit only the device-type-specific setting, with the jump FQDN as the fallback when the type is unknown.
    lib/rdk/startStunnel.sh:163
  • mktemp -u only selects a nonexistent pathname; it does not reserve it. A local process can create or replace $PIPE before mkfifo/exec, so the passcode written to the descriptor below can be redirected to attacker-controlled storage. Create a private temporary directory with mktemp -d and create the FIFO inside it.
    lib/rdk/startStunnel.sh:199
  • The newly added early exit bypasses the cleanup immediately below this block (rm -f $STUNNEL_CONF_FILE and rm -f $D_FILE). If stunnel fails, the temporary configuration and generated credential material can remain on disk; clean them before returning on this error path.
    lib/rdk/timesyncd-conf-update.sh:57
  • The new retry/bootstrap logic is unreachable: both restart-timesyncd.service and restart-timesyncd.path are deleted in this change, and this is the only remaining reference to the script. As a result, /tmp/route_available no longer triggers NTP configuration updates. Retain/recreate a unit or caller, or remove this partial migration.
    systemd_units/NetworkManager.path:5
  • The repository's Makefile install target copies *.service and *.timer units but never *.path units, so this new path file is not included in the generated package and its PathExists behavior will not be installed. Add the path-unit packaging step or otherwise wire this file into the image build.
    systemd_units/NetworkManager_ecfs.conf:3
  • This new .conf is under systemd_units, but the repository Makefile only packages etc/*.conf; it does not install systemd_units/*.conf. As a result, the NetworkManager ordering fragment will be absent from the generated package unless another image-level installer handles it. Add an explicit install rule or move it to the consumed configuration location.
  • Files reviewed: 65/65 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread .github/workflows/cla.yml
Comment on lines +16 to +20
CLA-Lite:
name: "Signature"
uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }}
Comment on lines +18 to +21
if: >
github.event.review.state == 'approved' &&
github.event.pull_request.base.ref == 'main' &&
startsWith(github.event.pull_request.head.ref, 'release/')

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical runtime, packaging, and network-readiness issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (11)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/component-release-workflow-usage.md:92

  • The documentation says to enforce review rules on develop, but the approvable workflow creates the release PR against main (component-release.yml:160-162) and the finish workflow only handles PRs whose base is main (component-release-finish-on-approval.yml:19-21). This directs maintainers to protect the wrong branch and can leave the release PR ungated.

lib/rdk/alertSystem.sh:106

  • The raw arguments are interpolated into JSON without escaping. A normal alert containing a quote, backslash, or newline produces invalid JSON, so the upload is rejected; the deep-sleep branch also uses the raw message as a JSON key. Construct the payload with a JSON encoder before sending it.
    strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
    strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"

lib/rdk/getDeviceDetails.sh:285

  • These calls now run regardless of BLUETOOTH_ENABLED. When Bluetooth is disabled, readBTAddress-generic.sh emits an empty value, overwriting the existing 00:00:00:00:00:00 default and writing an empty bluetooth_mac into the device-details cache. Keep the enabled check around both vendor and generic readers.
    if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
        bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
    else
        bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`

lib/rdk/readBTAddress-generic.sh:31

  • When BLUETOOTH_ENABLED is not true, bluetooth_mac is never initialized and this script prints an empty value. getDeviceDetails.sh now always replaces its 00:00:00:00:00:00 default with this output on devices without the vendor helper, so the cached Bluetooth MAC regresses to blank. Initialize the generic value before the condition and echo it quoted.
    lib/rdk/rebootNow.sh:1
  • The deleted script is still installed as /rebootNow.sh by Makefile:86, and multiple scripts in this tree still invoke that path (factory-reset.sh, warehouse-reset.sh, restore, and userInitiatedFWDnld.sh). This leaves a dangling symlink in the package and makes those reboot paths fail at runtime unless the callers and package are migrated together.
    lib/rdk/rebootSTB.sh:1
  • Makefile:85 still creates /rebootSTB.sh as a symlink to this deleted file, so every package contains a dangling reboot script entry. Remove that install step or provide the replacement implementation together with the deletion.
    lib/rdk/startStunnel.sh:160
  • mktemp -u only generates an unused pathname, so another local process can create a file or symlink before mkfifo runs. If mkfifo fails, this code logs the error but continues to open and write the path, which can expose the passcode. Create the FIFO atomically inside a private temporary directory and abort on creation/open failure.
    lib/rdk/startStunnel.sh:115
  • For every non-empty device type, this appends checkHost at line 115 and then appends a second checkHost directive at line 123 or 127. The generated stunnel service section therefore contains duplicate directives (or silently lets the later SAN override the jump FQDN), breaking the intended device-type selection. Select the host first and emit exactly one checkHost line, using JUMP_FQDN only for the unknown-type fallback.
    lib/rdk/wh_api_5.conf:46
  • x1hello.object is a file path, but it was added under the [dirs] section. The configuration explicitly separates [files] (lines 27-32) from [dirs] (line 34 onward), so Warehouse API 5 will interpret this entry with directory semantics and may not validate/remove the object. Move this entry into [files].
    systemd_units/NetworkManager.path:6
  • This new .path unit is not packaged by the repository's Makefile: its install rule copies only systemd_units/*.service and systemd_units/*.timer. Consequently NetworkManager.path will be absent from the generated package and cannot trigger NetworkManager.service. Update the packaging/install layout for path units.
    systemd_units/NetworkManager_ecfs.conf:3
  • This file is neither a recognized standalone systemd unit nor installed by the Makefile (which does not copy systemd_units/*.conf). Unless it is placed as a NetworkManager.service.d drop-in by another packaging step, the After/Wants ordering is ignored and NetworkManager can start before securemount.service and bootversion-loader.service. Install it at the drop-in path or merge the dependency into the packaged service.
  • Files reviewed: 65/65 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines +35 to +36
if [[ "$SSID_LINE" =~ ssid=\"(.*)\" ]]; then
SSID="${BASH_REMATCH[1]}"
Comment thread lib/rdk/alertSystem.sh
Comment on lines +54 to +55
if [ -f $RDK_PATH/exec_curl_mtls.sh ]; then
. $RDK_PATH/exec_curl_mtls.sh

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues affect packaged systemd behavior, reboot paths, networking, and alert handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (15)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/component-release-workflow-usage.md:92

  • The release workflow creates the approvable PR against main and the finish workflow only handles PRs whose base is main, but this documentation tells maintainers to enforce review rules on develop. That leaves the actual release PR without the documented protection.

.github/workflows/component-release.yml:210

  • This branch only checks for an existing local hotfix/<version> branch. On a rerun after that branch was published, it exists on origin but not in the fresh runner checkout, so the else tries to create a local branch with the same name from SOURCE_BRANCH and fails instead of resuming the release.
          if git show-ref --verify --quiet "refs/heads/${hotfix_branch}"; then
            git checkout "${hotfix_branch}"
          else
            git checkout -b "${hotfix_branch}" "${SOURCE_BRANCH}"
            echo "CREATED_HOTFIX_BRANCH=true" >> "$GITHUB_ENV"

lib/rdk/alertSystem.sh:106

  • The JSON payload is assembled by interpolating MSG_DATA and the other fields without JSON escaping. An alert containing a quote, backslash, or newline produces invalid JSON or changes the structure sent to the endpoint, causing valid alerts to fail or be misrepresented. Build the payload with a JSON serializer or escape every value before interpolation.
    strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
    strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"

lib/rdk/alertSystem.sh:43

  • This script uses $RDK_PATH on lines 54-55, but it only sources device.properties; RDK_PATH is defined by /etc/include.properties. When invoked as the documented standalone/systemd script, the mTLS helper and partner-ID helper are looked up under / and the script exits before sending the alert.
if [ -f /etc/device.properties ];then
     . /etc/device.properties
fi

lib/rdk/alertSystem.sh:36

  • The new comment misspells “Assignment,” which makes the inline documentation less clear.
# Argument Assigment

lib/rdk/alertSystem.sh:77

  • The new comment misspells “Logging.”
# Loggging should be handled by the caller 

lib/rdk/getDeviceDetails.sh:285

  • The BLUETOOTH_ENABLED guard was removed here, so the generic reader now runs even when Bluetooth is disabled. readBTAddress-generic.sh leaves bluetooth_mac unset in that case, which overwrites the 00:00:00:00:00:00 fallback with an empty value and changes the device details output. Keep the reader call inside the enabled check or make the reader preserve the fallback.
    if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
        bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
    else
        bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`

lib/rdk/readBTAddress-generic.sh:30

  • When BLUETOOTH_ENABLED=false, this branch leaves bluetooth_mac unset and prints an empty string. getDeviceDetails.sh now always assigns this script's output, so disabled-Bluetooth devices lose the previous 00:00:00:00:00:00 fallback and publish an empty MAC.
    lib/rdk/rebootNow.sh:1
  • Deleting this script leaves live callers in warehouse-reset.sh, factory-reset.sh, restore, userInitiatedFWDnLd.sh, and utils.sh that still invoke /rebootNow.sh; the Makefile also still creates a symlink to this removed source. Those reboot paths will fail unless all callers and packaging are switched to the replacement binary. Restore the script or update those references atomically.
    lib/rdk/rebootSTB.sh:1
  • The Makefile still creates /rebootSTB.sh as a symlink to this deleted source (Makefile:85), leaving a dangling executable in every package. Remove the stale install rule or retain the implementation so the packaged reboot entry point is valid.
    lib/rdk/startStunnel.sh:163
  • mktemp -u only chooses an unused name; it does not create or reserve it. Another process can replace PIPE before mkfifo/exec, and the code proceeds even when either operation fails, potentially directing the passcode to an attacker-controlled file or FIFO. Create the FIFO atomically in a private directory and abort before writing on any failure.
    lib/rdk/startStunnel.sh:115
  • checkHost is written here and then written again in both the TEST and PROD branches below. Stunnel treats checkHost as a single option; the duplicate entries can make the generated configuration invalid (and otherwise make the first value ineffective). Keep only the device-type-specific assignment or make the fallback conditional.
    lib/rdk/system_info_collector.sh:97
  • Removing the log_disk_usage call here removes the only invocation of the still-defined function at lines 38-41, so the collector no longer emits disk-space usage. That silently drops disk telemetry; restore the call or remove the function and update consumers if this is intentional.
    systemd_units/NetworkManager.path:6
  • This new .path unit is not included by this component's package: Makefile:37-38 installs only systemd_units/*.service and *.timer. Consequently this file never reaches systemd on packaged images, so /tmp/bootType cannot trigger the intended NetworkManager action. Add .path units to the packaging install step.
    systemd_units/NetworkManager_ecfs.conf:3
  • This drop-in is also stored under systemd_units, but the package install rules do not copy systemd_units/*.conf (they only copy service and timer units). The After/Wants relationship therefore is absent from the installed NetworkManager configuration. Install this file into the appropriate systemd drop-in location.
  • Files reviewed: 65/65 changed files
  • Comments generated: 1
  • Review effort level: Lite

fi
fi

[ "$(($GatewayLogTimeStamp+$GatewayLoggingInterval))" -le "$currentTime" ] && GatewayLogTimeStamp=$(($(date +%s)))
* RDKEMW-22087: Support configurable Dropbear host key files and command-line arguments

* RDKEMW-22087: Support configurable Dropbear host key files and command-line arguments

* RDKEMW-22087: Support configurable Dropbear host key files and command-line arguments

* RDKEMW-22087: Support configurable Dropbear host key files and command-line arguments- #585

* RDKEMW-22087: Allow connections to forwarded ports from any host

Reason for change: dropbear -a option was removed accidently by an earlier commit. Fixing by adding the option back to service file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Critical compatibility and packaging issues, plus multiple unresolved networking and runtime defects, block approval.

Review details

Suppressed comments (18)

Previously missed (2) — in code that hasn't changed since the last review.

lib/rdk/readBTAddress-generic.sh:30

  • When BLUETOOTH_ENABLED is not true, this script prints no MAC. getDeviceDetails.sh now invokes the helper unconditionally, so the previous 00:00:00:00:00:00 fallback is replaced with an empty bluetooth_mac value on non-Bluetooth devices.
    .github/workflows/component-release-workflow-usage.md:92
  • This prerequisite names develop, but the approvable workflow creates and finishes the release PR against main (component-release.yml:160-162 and component-release-finish-on-approval.yml:20). A repository following this instruction may leave the actual approval gate unprotected; document branch protection for main.

.github/workflows/component-release.yml:249

  • The failure cleanup checks for a local release/<version> ref, but git flow release finish deletes that local branch before the later push steps. If a push fails after finish, the remote release branch remains orphaned and the cleanup skips deleting it; check the remote ref directly when this run created the branch.
          if [[ "${RELEASE_TYPE}" == "main" ]]; then
            if [[ "${CREATED_RELEASE_BRANCH:-false}" == "true" ]] && git show-ref --verify --quiet "refs/heads/release/${RELEASE_VERSION}"; then
              git push origin --delete "release/${RELEASE_VERSION}" 2>/dev/null || true
            fi

lib/rdk/NM_Dispatcher.sh:198

  • The up path no longer starts connectivitycheck.sh, but network-up.path still waits for /tmp/connectivity_check_done. The newly added notify-network-ready.service is not pulled in by any in-repository unit or install dependency, so this removal leaves the connectivity event disconnected and downstream network-up.target consumers may never be activated by actual connectivity. Wire the notifier/check into the NetworkManager path or retain an equivalent trigger.
if [ "$interfaceStatus" = "up" ]; then
   
    CON_STATE=$(nmcli -t -f GENERAL.STATE device show "$interfaceName" 2>/dev/null | cut -d: -f2)
    NMdispatcherLog "Connection state of interface $interfaceName=$CON_STATE"
fi

lib/rdk/NM_preDown.sh:91

  • This script is executed with /bin/sh, but the new interface branches use [[ ... ]], which is not POSIX and is unavailable in common /bin/sh implementations. On those targets the delete handler will fail to match the interface and will not remove the IP cache or refresh device details; use POSIX [ ]/case or change the interpreter.
        if [[ "$ifc" == "$ESTB_INTERFACE" || "$ifc" == "$DEFAULT_ESTB_INTERFACE" || "$ifc" == "$ESTB_INTERFACE:0" ]]; then
            NMdispatcherLog "Updating Box/ESTB IP"
            rm -f /tmp/.$mode$ESTB_INTERFACE
            refresh_devicedetails "estb_ip"
        elif [[ "$ifc" == "$MOCA_INTERFACE" || "$ifc" == "$MOCA_INTERFACE:0" ]]; then

lib/rdk/Start_MaintenanceTasks.sh:179

  • The on-demand branch is selected only when TriggerType is the numeric value 5, but this invocation passes the string ondemand. When that path is reached the numeric test emits an illegal-number diagnostic and falls through to the regular-upload branch, so on-demand handling is skipped. Normalize the comparison to accept the string used here (or pass the numeric constant).
            "$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" >> /opt/logs/dcmscript.log

lib/rdk/alertSystem.sh:106

  • MSG_DATA is inserted directly into the JSON payload even though the script accepts it as an alert message. A quote, backslash, or newline in the message produces invalid JSON (and can also break the shell command string passed to the curl helper), causing alerts to fail; serialize/escape the fields and avoid constructing the request through an eval-style command string.
    strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
    strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"

lib/rdk/getDeviceDetails.sh:285

  • This now invokes the generic reader even when Bluetooth is disabled, but readBTAddress-generic.sh only assigns a value when BLUETOOTH_ENABLED=true and otherwise prints an empty string. That overwrites the existing 00:00:00:00:00:00 default and leaves bluetooth_mac empty in the device-details cache; keep the enabled check around both readers.
    if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
        bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
    else
        bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`

lib/rdk/networkConnectionRecovery.sh:299

  • The -ne 0 condition classifies every nonzero loss below 10% as the 10% telemetry bucket, despite the comment and marker meaning 10% loss. A 1-9% ping result will therefore emit WIFIV_WARN_PL_10PERC; require the 10% lower bound here.
    elif [ "$packetLoss" -ne 0 ] ; then
      #Send telemetry notification for 10% packet loss
      log "$version packet loss is WIFIV_WARN_PL_10PERC"
      t2CountNotify "WIFIV_WARN_PL_10PERC"

lib/rdk/networkConnectionRecovery.sh:232

  • When /tmp/checkpacketloss exists, the V6 call enters this outer branch and explicitly sets gwIp="", so it never evaluates the IPv6 default route. Because this file is used as an IPv4 gateway override, its presence suppresses IPv6 probing and makes the new IPv6-only handling ineffective; restrict the override to V4 and use normal route discovery for V6.
  if [ -f "/tmp/checkpacketloss" ] ; then
    if [ "$version" = "V4" ] ; then
      gwIp=$(cat /tmp/checkpacketloss)
      pingCmd="ping"
    else

lib/rdk/rebootNow.sh:1

  • Deleting this script without updating its consumers leaves the reboot path broken: warehouse-reset.sh, factory-reset.sh, userInitiatedFWDnld.sh, and utils.sh still invoke /rebootNow.sh, while Makefile:86 still creates a symlink to this now-missing file. Please retain a compatibility wrapper or update/install every caller to the replacement rebootnow binary before removing it.
    lib/rdk/rebootSTB.sh:1
  • This deletion leaves the packaging rule at Makefile:85 creating a dangling /rebootSTB.sh symlink to /lib/rdk/rebootSTB.sh. Remove or update that install rule as part of the migration, or retain the replacement entry point.
    lib/rdk/startLinkLocal.sh:56
  • The exit status of avahi-autoipd is ignored, and the script logs success and exits 0 even when the daemon cannot start. Callers will treat a failed link-local setup as successful; check the command result and return a failure after logging it.
    lib/rdk/startStunnel.sh:115
  • The unconditional checkHost = $JUMP_FQDN is followed by another checkHost directive in both the TEST and PROD branches. This produces duplicate service options (and may make stunnel reject the configuration or silently use the wrong hostname); emit exactly one value, using the SAN for known device types and JUMP_FQDN only for the unknown case.
    lib/rdk/startStunnel.sh:160
  • mktemp -u only selects a pathname; it does not create or reserve it. A local process can win the race before mkfifo/open, potentially redirecting the passcode written on line 173. Create a private temporary directory with mktemp -d and create the FIFO inside it (or use another atomic, permission-controlled mechanism).
    lib/rdk/startStunnel.sh:198
  • This newly added failure branch exits before the cleanup below, leaving the generated stunnel config and downloaded CA material on disk when stunnel fails to start. Clean the temporary config and credential files before returning from this branch, just as the later PID-failure path does.
    systemd_units/NetworkManager.path:9
  • This new path unit is not packaged by the current Makefile: the install target copies only systemd_units/*.service and *.timer, not *.path. Consequently the /tmp/bootType watcher will be absent at runtime and cannot trigger NetworkManager.
    systemd_units/NetworkManager_ecfs.conf:3
  • This [Unit] fragment is not installed as a NetworkManager.service drop-in. The Makefile sends *.conf files to /etc while the systemd install rule handles only .service and .timer files, and no NetworkManager.service.d directory is created; therefore these ordering dependencies will not be applied. Install it under the service drop-in directory or add an explicit install rule.
  • Files reviewed: 65/65 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

* RDK-61551: Revssh Hardening - Entertainement devices

Signed-off-by: ldonth501 <LasyaPrakarsha_DonthiVenkata@comcast.com>

* Improv telemetry markers

Signed-off-by: ldonth501 <LasyaPrakarsha_DonthiVenkata@comcast.com>

* After latest review comments

Signed-off-by: ldonth501 <LasyaPrakarsha_DonthiVenkata@comcast.com>

* Update startStunnel.sh

* Update startStunnel.sh

* Update startStunnel.sh

* Update startStunnel.sh

* Update startStunnel.sh

---------

Signed-off-by: ldonth501 <LasyaPrakarsha_DonthiVenkata@comcast.com>
Co-authored-by: ldonth501 <LasyaPrakarsha_DonthiVenkata@comcast.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Unresolved critical and moderate runtime, packaging, security, and release-workflow issues remain.

Review effort: Lite
Findings: 17 High severity · 13 Medium severity · 5 Low severity

Open (35)

And 15 more that still need to be addressed.

Previously missed (2)

In code that hasn't changed since last review

Medium severity Disabled Bluetooth overwrites the default MAC with empty output

lib/​rdk/​readBTAddress-generic.sh:30

When BLUETOOTH_ENABLED is not true, bluetooth_mac is never assigned and this script prints an empty value. getDeviceDetails.sh captures that output and overwrites its 00:00:00:00:00:00 fallback, so disabled-Bluetooth devices now report an empty MAC. Initialize the zero MAC before the conditional (or preserve the caller's fallback).

Low severity Approval PR targets main instead of the documented develop branch

.github/​workflows/​component-release-workflow-usage.md:93

The documentation says approvable-flow review rules should be enforced on develop, but component-release.yml creates the approval PR with --base main and the finish workflow also requires base.ref == 'main'. This prerequisite points maintainers at the wrong protected branch.

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.