Skip to content

SWRDKV-5447: ocdm-playready defect fix.#14

Merged
afranc083 merged 13 commits into
rdkcentral:developfrom
jianwang-brcm:feature/BCM-2076
Jul 17, 2026
Merged

SWRDKV-5447: ocdm-playready defect fix.#14
afranc083 merged 13 commits into
rdkcentral:developfrom
jianwang-brcm:feature/BCM-2076

Conversation

@jianwang-brcm

Copy link
Copy Markdown
Contributor

What it does: Replaces the assert(ivLength>0) with a runtime check that sampleInfo->ivLength is exactly EXPECTED_AES_CTR_IVDATA_SIZE (8) or EXPECTED_AES_CBC_IVDATA_SIZE (16) — returning CDMi_S_FALSE otherwise — and additionally clamps the Netflix-path memcpy to sizeof(iv_vector).

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI review requested due to automatic review settings June 29, 2026 16:23

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.

Pull request overview

This PR addresses stability issues in the PlayReady CDMi integration by hardening IV handling in decrypt, adding additional bounds checks around secure-token operations, and introducing session tracking to prevent resetting/freeing the shared PlayReady app context while sessions still reference it.

Changes:

  • Replaced assert(ivLength > 0) with a runtime validation that ivLength is exactly 8 (CTR) or 16 (CBC), and clamped a Netflix-path IV memcpy.
  • Added additional safety checks in the decrypt path to avoid buffer overruns (SVP token size, decrypted length vs. encrypted length).
  • Introduced m_sessionCount plus additional locking around app-context usage and lifecycle operations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
MediaSystem.cpp Adds session counting and additional locking to prevent app-context reset/uninit while sessions exist.
MediaSession.cpp Adds runtime IV length validation, clamps IV copy, adds several mutex guards, and adds extra length checks in decrypt paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MediaSystem.cpp
Comment thread MediaSystem.cpp Outdated
Comment thread MediaSystem.cpp Outdated
Comment thread MediaSystem.cpp
Comment thread MediaSystem.cpp
Comment thread MediaSession.cpp Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 18:40

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread MediaSystem.cpp
Comment thread MediaSystem.cpp
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 15, 2026 19:08

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread MediaSystem.cpp
Copilot AI review requested due to automatic review settings July 15, 2026 20:06

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread MediaSystem.cpp
Comment thread MediaSystem.cpp
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 15, 2026 20:17

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 15, 2026 20:21

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread MediaSystem.cpp Outdated
Comment thread MediaSession.cpp
Comment thread MediaSession.cpp
Comment thread MediaSession.cpp
Copilot AI review requested due to automatic review settings July 15, 2026 20:35

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread MediaSessionExt.cpp
Comment thread MediaSystem.cpp
Comment thread MediaSystem.cpp
Copilot AI review requested due to automatic review settings July 16, 2026 11:57

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread MediaSession.cpp
Comment thread MediaSystem.cpp Outdated
Comment thread MediaSystem.cpp
Copilot AI review requested due to automatic review settings July 16, 2026 12:10

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread MediaSession.cpp
Comment thread MediaSystem.cpp Outdated
Copilot AI review requested due to automatic review settings July 16, 2026 14:01

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread MediaSystem.cpp Outdated
Comment thread MediaSystem.cpp
Copilot AI review requested due to automatic review settings July 16, 2026 17:33

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

MediaSystem.cpp:645

  • UninitializeAppCtx() returns CDMi_S_FALSE when m_poAppContext is already null. Callers like DeleteSecureStore() now treat any non-success as fatal and will return early, which can prevent secure-store deletion in the common "already uninitialized" case. Consider treating "already uninitialized" as success when there are no active sessions.
        if (m_poAppContext.get() == nullptr)
        {
            return CDMi_S_FALSE;
        }

Comment thread MediaSystem.cpp
@afranc083
afranc083 merged commit 7a73e7a into rdkcentral:develop Jul 17, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants