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

Issue 2220183003: Rust: Add validation to decode (Closed)

Created:
4 years, 4 months ago by mknyszek
Modified:
4 years, 4 months ago
Reviewers:
Eric Holk, phosek, jamesr
Base URL:
git@github.com:domokit/mojo.git@coder-testing
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Rust: Add validation checks to decode In the Rust bindings we now perform validation of the input buffer on Mojom decode. The generated code checked in for tests has been updated as well in order to test validation in nearly all of the cases outlined in the "golden" files. The only missing tests to run are the integration tests which are to come in a future CL. R=eholk@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/4fbb11a4a65151bbc73545a9f2dbc4627db9d0a0

Patch Set 1 #

Patch Set 2 : Pass all tests #

Total comments: 2

Patch Set 3 : Ran rustfmt, cleaned up with try! #

Total comments: 1

Patch Set 4 : Update from upstream branches (fixed arrays, validation code, etc.) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1659 lines, -756 lines) Patch
M mojo/public/rust/src/bindings/decoding.rs View 1 2 3 5 chunks +158 lines, -12 lines 0 comments Download
M mojo/public/rust/src/bindings/encoding.rs View 1 2 3 chunks +12 lines, -2 lines 0 comments Download
M mojo/public/rust/src/bindings/macros.rs View 1 2 3 chunks +14 lines, -8 lines 0 comments Download
M mojo/public/rust/src/bindings/message.rs View 1 2 4 chunks +21 lines, -14 lines 0 comments Download
M mojo/public/rust/src/bindings/mojom.rs View 1 2 3 26 chunks +151 lines, -85 lines 0 comments Download
M mojo/public/rust/src/bindings/run_loop.rs View 1 2 10 chunks +40 lines, -31 lines 0 comments Download
M mojo/public/rust/tests/encoding.rs View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
A mojo/public/rust/tests/regression.rs View 1 2 3 1 chunk +107 lines, -0 lines 0 comments Download
M mojo/public/rust/tests/util/mod.rs View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/rust/tests/util/mojom_validation.rs View 1 2 3 51 chunks +1025 lines, -600 lines 0 comments Download
A mojo/public/rust/tests/validation.rs View 1 1 chunk +127 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 10 (5 generated)
mknyszek
Added validation code to the decode path.
4 years, 4 months ago (2016-08-08 20:03:28 UTC) #2
Eric Holk
lgtm https://codereview.chromium.org/2220183003/diff/20001/mojo/public/rust/tests/util/mojom_validation.rs File mojo/public/rust/tests/util/mojom_validation.rs (right): https://codereview.chromium.org/2220183003/diff/20001/mojo/public/rust/tests/util/mojom_validation.rs#newcode361 mojo/public/rust/tests/util/mojom_validation.rs:361: match state.decode_struct_header(&StructGVersions) { You use this pattern a ...
4 years, 4 months ago (2016-08-08 20:34:15 UTC) #3
mknyszek
https://codereview.chromium.org/2220183003/diff/20001/mojo/public/rust/tests/util/mojom_validation.rs File mojo/public/rust/tests/util/mojom_validation.rs (right): https://codereview.chromium.org/2220183003/diff/20001/mojo/public/rust/tests/util/mojom_validation.rs#newcode361 mojo/public/rust/tests/util/mojom_validation.rs:361: match state.decode_struct_header(&StructGVersions) { On 2016/08/08 20:34:15, Eric Holk wrote: ...
4 years, 4 months ago (2016-08-08 21:32:22 UTC) #4
mknyszek
https://codereview.chromium.org/2220183003/diff/40001/mojo/public/rust/src/bindings/run_loop.rs File mojo/public/rust/src/bindings/run_loop.rs (left): https://codereview.chromium.org/2220183003/diff/40001/mojo/public/rust/src/bindings/run_loop.rs#oldcode207 mojo/public/rust/src/bindings/run_loop.rs:207: /// notion of "now". Oops, this was an accident. ...
4 years, 4 months ago (2016-08-08 22:47:25 UTC) #5
mknyszek
4 years, 4 months ago (2016-08-10 17:33:58 UTC) #10
Message was sent while issue was closed.
Committed patchset #4 (id:100001) manually as
4fbb11a4a65151bbc73545a9f2dbc4627db9d0a0 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698