Closed Bug 1842676 Opened 1 year ago Closed 1 year ago

[wmfme] add test for PlayReady key system

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

No description provided.
Attachment #9343133 - Attachment description: WIP: Bug 1842676 - add test for PlayReady. → Bug 1842676 - add test for PlayReady.
Attachment #9343133 - Attachment description: Bug 1842676 - add test for PlayReady. → WIP: Bug 1842676 - part1 : add test for PlayReady.

Currently whenever we create a WMFCDMImpl, it would always create a new
MFCDMChild/MFCDMParent. However, we won't always need those actors
because we can query the capabilities from cached result [1]

Therefore, we should only create CDM actor pair when we have a need to
communicate with the remote process, which can reduce unnecessary IPC
calls.

[1] https://searchfox.org/mozilla-central/rev/2d06b7d5fbfa7a31776389da87c5f895b80df8d9/dom/media/eme/mediafoundation/WMFCDMImpl.cpp#83-97

Depends on D183619

AddressSanitizer reported a false alarm [1] about the UAF in
MFCDMChild. The acutal situation is we create two MFCDMChilds in the
same address, the first one is created for checking the capabilites for
'com.microsoft.playready.recommendation', and the second one is created
for checking the capabilities for 'com.microsoft.playready.recommendation.3000'.

The WMFProxyImpl creates a one-time use MFCDMChild to check the
capabilites, and our implementation would go through every key system to
get their configs [2].

The issue happens when we finish checking 'com.microsoft.playready.recommendation',
then we will check its hardware key system, which creates a new
MFCDMChild sharing with the same address of the previous one that is
just destroyed.

AddressSanitizer thinks that is an UAF, but it's not. To workaround this
problem, we would store the config for 'com.microsoft.playready.recommendation.3000'
when asking 'com.microsoft.playready.recommendation' with the hardware
secure flag because they are exact the same. By doing this, we won't
create a second MFCDMChild, because we can get the capabilities from
cached result.

[1] https://treeherder.mozilla.org/logviewer?job_id=422617141&repo=try&lineNumber=5092
[2] https://searchfox.org/mozilla-central/rev/2d06b7d5fbfa7a31776389da87c5f895b80df8d9/dom/media/eme/MediaKeySystemAccess.cpp#168-178

Depends on D183620

Attachment #9343133 - Attachment description: WIP: Bug 1842676 - part1 : add test for PlayReady. → Bug 1842676 - part1 : add test for PlayReady.
Attachment #9343970 - Attachment description: WIP: Bug 1842676 - part2 : add MOZ_COUNT_CTOR/MOZ_COUNT_DTOR to track leaking. → Bug 1842676 - part2 : add MOZ_COUNT_CTOR/MOZ_COUNT_DTOR to track leaking.
Attachment #9343971 - Attachment description: WIP: Bug 1842676 - part3 : do not create CDM actor pair if we are not going to communicate with the remote process. → Bug 1842676 - part3 : do not create CDM actor pair if we are not going to communicate with the remote process.
Attachment #9343972 - Attachment description: WIP: Bug 1842676 - part4 : store the result for PlayReady HWDRM when querying the result com.microsoft.playready.recommendation. → Bug 1842676 - part4 : store the result for PlayReady HWDRM when querying the result com.microsoft.playready.recommendation.
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/42cc5d4d7461
part1 : add test for PlayReady. r=jolin
https://hg.mozilla.org/integration/autoland/rev/7784e13807f4
part2 : add MOZ_COUNT_CTOR/MOZ_COUNT_DTOR to track leaking. r=media-playback-reviewers,jolin
https://hg.mozilla.org/integration/autoland/rev/1b022762162e
part3 : do not create CDM actor pair if we are not going to communicate with the remote process. r=media-playback-reviewers,jolin
https://hg.mozilla.org/integration/autoland/rev/39e6f7a75cd4
part4 : store the result for PlayReady HWDRM when querying the result com.microsoft.playready.recommendation. r=media-playback-reviewers,jolin
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: