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

Issue 2950233002: Validate untrusted VR mojo inputs into browser process (Closed)

Created:
3 years, 6 months ago by billorr
Modified:
3 years, 5 months ago
Reviewers:
mthiesse, bajones, bajones1
CC:
chromium-reviews, feature-vr-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Validate untrusted VR mojo inputs into browser process For defense in depth, we cannot trust data coming from the renderer processes. This change hardens the mojo API surface by validating parameters before using them. frame_index on SubmitFrame and UpdateLayerBounds could be used to read/write undesired memory locations (by passing in negative indices), but aren't obviously attackable. Viewports could contain NANs or invalid rectangles, and the desired size could be too large/small. BUG=729852 Review-Url: https://codereview.chromium.org/2950233002 Cr-Commit-Position: refs/heads/master@{#486585} Committed: https://chromium.googlesource.com/chromium/src/+/0cdabaee801fff51aa2d90258c58da52a4e8b118

Patch Set 1 #

Total comments: 5

Patch Set 2 : make validation less strict, and fix a bug found with validation #

Total comments: 8

Patch Set 3 : cr feedback #

Patch Set 4 : add test and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -3 lines) Patch
M chrome/browser/android/vr_shell/vr_shell_gl.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_gl.cc View 1 2 3 5 chunks +43 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/vr/requestPresent_reject_NaN_bounds.html View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/VRDisplay.cpp View 1 2 2 chunks +25 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (15 generated)
billorr
PTAL https://codereview.chromium.org/2950233002/diff/1/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2950233002/diff/1/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1603 chrome/browser/android/vr_shell/vr_shell_gl.cc:1603: // Size should be between at least 2 ...
3 years, 6 months ago (2017-06-22 00:28:34 UTC) #2
mthiesse
+bajones for review/opinions. https://codereview.chromium.org/2950233002/diff/1/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2950233002/diff/1/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1593 chrome/browser/android/vr_shell/vr_shell_gl.cc:1593: return bounds.x() < bounds.right() && bounds.y() ...
3 years, 6 months ago (2017-06-22 05:59:47 UTC) #4
billorr
Michael/Brandon, could one of you take a look at the latest iteration? https://codereview.chromium.org/2950233002/diff/1/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc ...
3 years, 5 months ago (2017-07-10 18:59:24 UTC) #5
mthiesse
https://codereview.chromium.org/2950233002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2950233002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1603 chrome/browser/android/vr_shell/vr_shell_gl.cc:1603: float left = std::max(0.0f, std::min(bounds.x(), 1.0f)); I think you ...
3 years, 5 months ago (2017-07-11 14:52:24 UTC) #6
mthiesse
Also, are these error cases testable with LayoutTests?
3 years, 5 months ago (2017-07-11 14:53:05 UTC) #7
bajones1
Agree with mthiesse@'s comments, and had one question of my own, but otherwise this is ...
3 years, 5 months ago (2017-07-11 17:11:06 UTC) #9
billorr
On 2017/07/11 14:53:05, mthiesse wrote: > Also, are these error cases testable with LayoutTests? I ...
3 years, 5 months ago (2017-07-13 00:31:29 UTC) #10
billorr
https://codereview.chromium.org/2950233002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2950233002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1603 chrome/browser/android/vr_shell/vr_shell_gl.cc:1603: float left = std::max(0.0f, std::min(bounds.x(), 1.0f)); On 2017/07/11 14:52:24, ...
3 years, 5 months ago (2017-07-13 00:31:41 UTC) #11
mthiesse
On 2017/07/13 00:31:29, billorr wrote: > On 2017/07/11 14:53:05, mthiesse wrote: > > Also, are ...
3 years, 5 months ago (2017-07-13 14:54:07 UTC) #12
billorr
Ahh you meant to check the js side validation? I thought you meant the browser ...
3 years, 5 months ago (2017-07-13 15:39:18 UTC) #13
mthiesse
lgtm once tests are added.
3 years, 5 months ago (2017-07-13 15:50:48 UTC) #14
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/2950233002/60001
3 years, 5 months ago (2017-07-13 23:01:31 UTC) #21
mthiesse
You'll still need an lg from Brandon for webkit owners.
3 years, 5 months ago (2017-07-13 23:04:52 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/489386)
3 years, 5 months ago (2017-07-13 23:13:08 UTC) #24
bajones
On 2017/07/13 23:13:08, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 5 months ago (2017-07-14 00:35:38 UTC) #25
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/2950233002/60001
3 years, 5 months ago (2017-07-14 00:40:38 UTC) #27
commit-bot: I haz the power
3 years, 5 months ago (2017-07-14 01:12:40 UTC) #32
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/0cdabaee801fff51aa2d90258c58...

Powered by Google App Engine
This is Rietveld 408576698