Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Issue 2582463003: media: Verify CDM Host files (Closed)

Created:
4 years ago by xhwang
Modified:
3 years, 11 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org, mcasas+watch+vc_chromium.org, eme-reviews_chromium.org, ddorwin, Haoming Chen, Rintaro Kuroiwa
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Verify CDM host files This change provides the Content Decryption Module (CDM) a way to verify the host files, the CDM adapter and the CDM itself. GetCdmHostFilePath() provides a list of host files. CdmHostFile opens the pair of a file and its corresponding signature file. CdmHostFiles manages all files (and signature files) opened for verification. On platforms that use the Zygote, files are opened in the Zygote process. After a child process is forked, if it's not a ppapi process, all files will be immediately closed. On other platforms, files are opened after the ppapi process is launched, but before the sandbox is sealed. On all platforms, if the ppapi process hosts a CDM, VerifyHostFiles() will be called with the files managed in CdmHostFiles. Then all opened files will be closed. A browser test is added to make sure files are opened correctly and are passed in VerifyHostFiles() as expected. BUG=658036 TEST=New browser_tests added. Review-Url: https://codereview.chromium.org/2582463003 Cr-Commit-Position: refs/heads/master@{#446260} Committed: https://chromium.googlesource.com/chromium/src/+/785a834775112c711cda038e3ae51a01c3a029dc

Patch Set 1 #

Total comments: 55

Patch Set 2 : rebase only #

Patch Set 3 : Polished! #

Total comments: 21

Patch Set 4 : comments addressed #

Total comments: 15

Patch Set 5 : kerrnel/tinskip's comments addressed/replied #

Patch Set 6 : rebase only #

Patch Set 7 : renames based on new API #

Patch Set 8 : VerifyFiles() now returns a boolean. #

Total comments: 8

Patch Set 9 : comments addressed #

Total comments: 4

Patch Set 10 : comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+931 lines, -22 lines) Patch
M chrome/browser/media/encrypted_media_browsertest.cc View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/common/BUILD.gn View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_content_client.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M chrome/common/chrome_content_client.cc View 1 2 3 4 5 6 7 8 2 chunks +27 lines, -14 lines 0 comments Download
A chrome/common/media/cdm_host_file_path.h View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/common/media/cdm_host_file_path.cc View 1 2 3 4 5 6 7 8 9 1 chunk +103 lines, -0 lines 0 comments Download
M chrome/renderer/media/chrome_key_systems.cc View 1 2 3 4 5 6 3 chunks +8 lines, -0 lines 0 comments Download
M content/app/content_main_runner.cc View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/media/cdm_registry_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/browser/ppapi_plugin_process_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/zygote_host/zygote_communication_linux.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -2 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
A content/common/media/cdm_host_file.h View 1 2 1 chunk +53 lines, -0 lines 0 comments Download
A content/common/media/cdm_host_file.cc View 1 2 3 4 5 6 7 8 9 1 chunk +72 lines, -0 lines 0 comments Download
A content/common/media/cdm_host_files.h View 1 2 3 4 5 6 7 1 chunk +110 lines, -0 lines 0 comments Download
A content/common/media/cdm_host_files.cc View 1 2 3 4 5 6 7 8 1 chunk +338 lines, -0 lines 0 comments Download
M content/common/media/cdm_info.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.cc View 1 2 3 4 5 6 7 3 chunks +32 lines, -0 lines 0 comments Download
M content/public/common/cdm_info.h View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M content/public/common/content_client.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -3 lines 0 comments Download
M content/zygote/zygote_main_linux.cc View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M media/base/media_switches.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M media/cdm/cdm_paths.h View 1 chunk +3 lines, -0 lines 0 comments Download
M media/cdm/cdm_paths.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M media/cdm/ppapi/external_clear_key/clear_key_cdm.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M media/cdm/ppapi/external_clear_key/clear_key_cdm.cc View 1 2 3 4 5 6 7 chunks +50 lines, -1 line 0 comments Download
M media/test/data/eme_player_js/globals.js View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M media/test/data/eme_player_js/player_utils.js View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 87 (38 generated)
xhwang
This is a prototype CL, so it definitely needs more polish (and tests). But, before ...
4 years ago (2016-12-16 01:06:55 UTC) #4
xhwang
https://codereview.chromium.org/2582463003/diff/1/content/ppapi_plugin/ppapi_thread.cc File content/ppapi_plugin/ppapi_thread.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/ppapi_plugin/ppapi_thread.cc#newcode458 content/ppapi_plugin/ppapi_thread.cc:458: cdm_host_files->VerifyFiles(library.get(), path); tinskip / hmchen: This will be called ...
4 years ago (2016-12-16 01:08:27 UTC) #5
xhwang
https://codereview.chromium.org/2582463003/diff/1/content/ppapi_plugin/ppapi_thread.cc File content/ppapi_plugin/ppapi_thread.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/ppapi_plugin/ppapi_thread.cc#newcode358 content/ppapi_plugin/ppapi_thread.cc:358: std::unique_ptr<CdmHostFiles> cdm_host_files; Use a local instance such that if ...
4 years ago (2016-12-16 01:23:03 UTC) #8
jrummell
Initial comments after a quick review. https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc File content/common/media/cdm_host_file.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc#newcode40 content/common/media/cdm_host_file.cc:40: new CdmHostFile(file_path, std::move(file), ...
4 years ago (2016-12-16 20:21:30 UTC) #9
Greg K
This seems to be on the right track, but I asked a few questions so ...
4 years ago (2016-12-16 22:10:41 UTC) #10
xhwang
Answered Greg's questions https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h File content/common/media/cdm_host_files.h (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h#newcode28 content/common/media/cdm_host_files.h:28: #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_MACOSX) ...
4 years ago (2016-12-16 22:30:15 UTC) #11
Greg K
https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h File content/common/media/cdm_host_files.h (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h#newcode28 content/common/media/cdm_host_files.h:28: #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_MACOSX) && \ On ...
4 years ago (2016-12-16 22:34:41 UTC) #12
xhwang
https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h File content/common/media/cdm_host_files.h (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h#newcode28 content/common/media/cdm_host_files.h:28: #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_MACOSX) && \ On ...
4 years ago (2016-12-16 22:37:07 UTC) #13
xhwang
kindly post-holiday ping!
3 years, 11 months ago (2017-01-04 22:15:17 UTC) #14
Haoming Chen
https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h File content/common/media/cdm_host_files.h (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_files.h#newcode73 content/common/media/cdm_host_files.h:73: // Opens CDM specific files for the CDM adapter ...
3 years, 11 months ago (2017-01-04 22:23:39 UTC) #15
Greg K
On a high level, this looks like a reasonable approach. https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc File content/common/media/cdm_host_file.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc#newcode32 ...
3 years, 11 months ago (2017-01-09 21:45:15 UTC) #16
tinskip1
https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc File content/common/media/cdm_host_file.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc#newcode32 content/common/media/cdm_host_file.cc:32: base::File sig_file(sig_file_path, On 2017/01/09 21:45:14, Greg K wrote: > ...
3 years, 11 months ago (2017-01-09 23:49:30 UTC) #17
xhwang
rebase only
3 years, 11 months ago (2017-01-12 06:34:47 UTC) #18
xhwang
Thanks for the feedback! I replied to the comments (with a lot of will-do). Next ...
3 years, 11 months ago (2017-01-12 20:15:03 UTC) #19
xhwang
https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc File content/common/media/cdm_host_file.cc (right): https://codereview.chromium.org/2582463003/diff/1/content/common/media/cdm_host_file.cc#newcode32 content/common/media/cdm_host_file.cc:32: base::File sig_file(sig_file_path, On 2017/01/12 20:15:02, xhwang wrote: > On ...
3 years, 11 months ago (2017-01-18 06:03:59 UTC) #23
xhwang
tinskip1 / jrummell /Greg K: The CL is now updated and bots are all green. ...
3 years, 11 months ago (2017-01-18 06:49:59 UTC) #25
xhwang
alexmos: Please OWNERS review content/* changes except for content/common/media/* sky: Please OWNERS review chrome/* changes. ...
3 years, 11 months ago (2017-01-18 17:53:17 UTC) #30
jrummell
lgtm w/nits https://codereview.chromium.org/2582463003/diff/40001/chrome/common/BUILD.gn File chrome/common/BUILD.gn (right): https://codereview.chromium.org/2582463003/diff/40001/chrome/common/BUILD.gn#newcode176 chrome/common/BUILD.gn:176: "//chrome/common:version_header", Is this needed? It appears you ...
3 years, 11 months ago (2017-01-18 21:46:45 UTC) #31
xhwang
comments addressed
3 years, 11 months ago (2017-01-18 22:28:48 UTC) #32
xhwang
jrummell's comments addressed https://codereview.chromium.org/2582463003/diff/40001/chrome/common/BUILD.gn File chrome/common/BUILD.gn (right): https://codereview.chromium.org/2582463003/diff/40001/chrome/common/BUILD.gn#newcode176 chrome/common/BUILD.gn:176: "//chrome/common:version_header", On 2017/01/18 21:46:45, jrummell wrote: ...
3 years, 11 months ago (2017-01-18 22:29:08 UTC) #33
tinskip1
https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc File chrome/browser/media/encrypted_media_browsertest.cc (right): https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc#newcode62 chrome/browser/media/encrypted_media_browsertest.cc:62: const char kExternalClearKeyVerifyHostFilesTestKeySystem[] = Suggest: Shorten from VerifyHostFiles to ...
3 years, 11 months ago (2017-01-19 03:42:47 UTC) #38
Greg K
Some comments here. I don't see any scripts to generate the .sig files during the ...
3 years, 11 months ago (2017-01-19 04:13:07 UTC) #39
xhwang
kerrnel: Chrome sig files should be available on Windows now. We are still working on ...
3 years, 11 months ago (2017-01-19 08:30:51 UTC) #40
tinskip1
Best time for these changes is now, before initial release. Thanks. https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc File chrome/browser/media/encrypted_media_browsertest.cc (right): ...
3 years, 11 months ago (2017-01-19 17:36:38 UTC) #45
xhwang
https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc File chrome/browser/media/encrypted_media_browsertest.cc (right): https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc#newcode62 chrome/browser/media/encrypted_media_browsertest.cc:62: const char kExternalClearKeyVerifyHostFilesTestKeySystem[] = On 2017/01/19 17:36:38, tinskip1 wrote: ...
3 years, 11 months ago (2017-01-19 17:46:07 UTC) #46
xhwang
https://codereview.chromium.org/2582463003/diff/60001/chrome/common/media/cdm_host_file_path.cc File chrome/common/media/cdm_host_file_path.cc (right): https://codereview.chromium.org/2582463003/diff/60001/chrome/common/media/cdm_host_file_path.cc#newcode40 chrome/common/media/cdm_host_file_path.cc:40: FILE_PATH_LITERAL("chrome.exe")}; On 2017/01/19 17:36:38, tinskip1 wrote: > On 2017/01/19 ...
3 years, 11 months ago (2017-01-19 17:57:11 UTC) #47
tinskip1
https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc File chrome/browser/media/encrypted_media_browsertest.cc (right): https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc#newcode62 chrome/browser/media/encrypted_media_browsertest.cc:62: const char kExternalClearKeyVerifyHostFilesTestKeySystem[] = On 2017/01/19 17:46:06, xhwang_slow wrote: ...
3 years, 11 months ago (2017-01-19 18:02:17 UTC) #48
xhwang
On 2017/01/19 18:02:17, tinskip1 wrote: > https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc > File chrome/browser/media/encrypted_media_browsertest.cc (right): > > https://codereview.chromium.org/2582463003/diff/60001/chrome/browser/media/encrypted_media_browsertest.cc#newcode62 > ...
3 years, 11 months ago (2017-01-19 18:24:13 UTC) #49
xhwang
rebase only
3 years, 11 months ago (2017-01-19 23:18:22 UTC) #50
xhwang
tinskip's comments addressed. Sorry I have to rebase to get the new API. PTAL again!
3 years, 11 months ago (2017-01-20 00:37:10 UTC) #53
tinskip1
lgtm
3 years, 11 months ago (2017-01-20 01:33:16 UTC) #54
xhwang
Now I get approval from media/CDM owners. Greg: Please review from security's perspective. alexmos: Please ...
3 years, 11 months ago (2017-01-20 01:39:10 UTC) #55
sky
sky->jam
3 years, 11 months ago (2017-01-20 16:38:59 UTC) #59
jam
https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc File content/browser/ppapi_plugin_process_host.cc (right): https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc#newcode404 content/browser/ppapi_plugin_process_host.cc:404: switches::kIgnoreMissingCdmHostFileForTesting, this isn't a testing only flag anymore then? ...
3 years, 11 months ago (2017-01-23 17:45:45 UTC) #60
xhwang
comments addressed
3 years, 11 months ago (2017-01-23 23:14:56 UTC) #61
xhwang
jam: Thanks for the comments. PTAL again! https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc File content/browser/ppapi_plugin_process_host.cc (right): https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc#newcode404 content/browser/ppapi_plugin_process_host.cc:404: switches::kIgnoreMissingCdmHostFileForTesting, On ...
3 years, 11 months ago (2017-01-23 23:16:09 UTC) #64
jam
https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc File content/browser/ppapi_plugin_process_host.cc (right): https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc#newcode404 content/browser/ppapi_plugin_process_host.cc:404: switches::kIgnoreMissingCdmHostFileForTesting, On 2017/01/23 23:16:09, xhwang_slow wrote: > On 2017/01/23 ...
3 years, 11 months ago (2017-01-24 00:39:24 UTC) #65
alexmos
LGTM https://codereview.chromium.org/2582463003/diff/140001/content/common/media/cdm_host_file.cc File content/common/media/cdm_host_file.cc (right): https://codereview.chromium.org/2582463003/diff/140001/content/common/media/cdm_host_file.cc#newcode27 content/common/media/cdm_host_file.cc:27: std::unique_ptr<CdmHostFile> CdmHostFile::Create( nit: // static
3 years, 11 months ago (2017-01-24 00:40:14 UTC) #66
xhwang
comments addressed
3 years, 11 months ago (2017-01-24 01:12:59 UTC) #67
xhwang
jam: PTAL again! https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc File content/browser/ppapi_plugin_process_host.cc (right): https://codereview.chromium.org/2582463003/diff/140001/content/browser/ppapi_plugin_process_host.cc#newcode404 content/browser/ppapi_plugin_process_host.cc:404: switches::kIgnoreMissingCdmHostFileForTesting, On 2017/01/24 00:39:24, jam wrote: ...
3 years, 11 months ago (2017-01-24 01:14:19 UTC) #68
xhwang
jam and kerrnel: Kindly ping! :)
3 years, 11 months ago (2017-01-24 23:44:51 UTC) #73
Greg K
From a security standpoint I care most that: 1) verification happens once the process is ...
3 years, 11 months ago (2017-01-25 06:15:32 UTC) #74
xhwang
https://codereview.chromium.org/2582463003/diff/40001/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc File media/cdm/ppapi/external_clear_key/clear_key_cdm.cc (right): https://codereview.chromium.org/2582463003/diff/40001/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc#newcode293 media/cdm/ppapi/external_clear_key/clear_key_cdm.cc:293: int bytes_written = file.Write(0, kDataToWrite, 1); On 2017/01/25 06:15:32, ...
3 years, 11 months ago (2017-01-25 06:51:54 UTC) #75
jam
lgtm, sorry for the delay as I missed your reply (ping me on IM if ...
3 years, 11 months ago (2017-01-26 00:10:24 UTC) #76
xhwang
Thank you all for the through review!
3 years, 11 months ago (2017-01-26 00:12:22 UTC) #77
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2582463003/180001
3 years, 11 months ago (2017-01-26 00:14:12 UTC) #80
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/220439)
3 years, 11 months ago (2017-01-26 03:56:19 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2582463003/180001
3 years, 11 months ago (2017-01-26 05:59:42 UTC) #84
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 06:47:22 UTC) #87
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/785a834775112c711cda038e3ae5...

Powered by Google App Engine
This is Rietveld 408576698