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

Issue 229683005: Validate MessageHeader before using (Closed)

Created:
6 years, 8 months ago by darin (slow to review)
Modified:
6 years, 7 months ago
Reviewers:
yzshen1, viettrungluu
CC:
chromium-reviews, Aaron Boodman, viettrungluu+watch_chromium.org, ben+mojo_chromium.org, abarth-chromium
Visibility:
Public.

Description

Validate MessageHeader before using On validation error, mimic a MessageReceiver returning false. Make that trigger the error state of Connector. BUG=357885 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267588

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : header validation #

Patch Set 4 : remove validation_interfaces.mojom for now #

Total comments: 25

Patch Set 5 : apply fixes per review feedback #

Total comments: 2

Patch Set 6 : address review feedback and fix build on windows #

Patch Set 7 : strip CRs #

Patch Set 8 : add some debug printfs #

Patch Set 9 : fix error caught by validate_header_bad_too_small #

Patch Set 10 : remove debug printfs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+395 lines, -6 lines) Patch
M mojo/common/test/test_support_impl.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/common/test/test_support_impl.cc View 1 2 3 4 5 2 chunks +47 lines, -0 lines 0 comments Download
M mojo/mojo_public.gypi View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -0 lines 0 comments Download
M mojo/public/c/test_support/test_support.h View 1 2 3 4 2 chunks +23 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/connector.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/lib/message.cc View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
A mojo/public/cpp/bindings/lib/message_header_validator.h View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/lib/message_header_validator.cc View 1 2 3 4 5 6 7 8 1 chunk +80 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/validation_unittest.cc View 1 2 3 4 5 6 8 9 1 chunk +128 lines, -0 lines 0 comments Download
A mojo/public/cpp/test_support/lib/test_support.cc View 1 2 1 chunk +26 lines, -0 lines 0 comments Download
M mojo/public/cpp/test_support/test_support.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_bad_too_small.data View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_bad_too_small.expected View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_bad_zeros.data View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_bad_zeros.expected View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_good_simple.data View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validate_header_good_simple.expected View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M mojo/public/tests/test_support_private.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M mojo/public/tests/test_support_private.cc View 1 2 2 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
darin (slow to review)
This is not all ready, but I'd like to get your take on this approach ...
6 years, 8 months ago (2014-04-25 17:47:06 UTC) #1
viettrungluu
I like the general approach. I wish that the input/expectation files were a bit more ...
6 years, 8 months ago (2014-04-25 21:55:58 UTC) #2
yzshen1
drive-by comments: https://codereview.chromium.org/229683005/diff/60001/mojo/public/c/test_support/test_support.h File mojo/public/c/test_support/test_support.h (right): https://codereview.chromium.org/229683005/diff/60001/mojo/public/c/test_support/test_support.h#newcode29 mojo/public/c/test_support/test_support.h:29: // heap-allocated strings. Each much be free'd ...
6 years, 8 months ago (2014-04-27 22:49:38 UTC) #3
darin (slow to review)
> I like the general approach. I wish that the input/expectation > files were a ...
6 years, 7 months ago (2014-04-29 06:31:44 UTC) #4
viettrungluu
On 2014/04/29 06:31:44, darin wrote: > > I like the general approach. I wish that ...
6 years, 7 months ago (2014-04-29 20:35:05 UTC) #5
viettrungluu
On 2014/04/29 20:35:05, viettrungluu wrote: > On 2014/04/29 06:31:44, darin wrote: > > > I ...
6 years, 7 months ago (2014-04-29 20:42:01 UTC) #6
viettrungluu
LGTM with nits, I guess. I guess we can ponder the test file format some ...
6 years, 7 months ago (2014-04-29 20:55:00 UTC) #7
darin (slow to review)
On 2014/04/29 20:55:00, viettrungluu wrote: > LGTM with nits, I guess. > > I guess ...
6 years, 7 months ago (2014-04-29 22:53:11 UTC) #8
darin (slow to review)
The CQ bit was checked by darin@chromium.org
6 years, 7 months ago (2014-04-30 03:50:21 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/darin@chromium.org/229683005/100001
6 years, 7 months ago (2014-04-30 03:51:50 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 05:17:01 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel on tryserver.chromium
6 years, 7 months ago (2014-04-30 05:17:01 UTC) #12
darin (slow to review)
The CQ bit was checked by darin@chromium.org
6 years, 7 months ago (2014-05-01 06:06:29 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/darin@chromium.org/229683005/170001
6 years, 7 months ago (2014-05-01 06:06:51 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-01 06:09:29 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel on tryserver.chromium
6 years, 7 months ago (2014-05-01 06:09:29 UTC) #16
darin (slow to review)
The CQ bit was checked by darin@chromium.org
6 years, 7 months ago (2014-05-01 15:45:26 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/darin@chromium.org/229683005/170001
6 years, 7 months ago (2014-05-01 15:46:04 UTC) #18
commit-bot: I haz the power
Change committed as 267588
6 years, 7 months ago (2014-05-01 18:24:50 UTC) #19
Tom Sepez
On 2014/04/29 20:55:00, viettrungluu wrote: > LGTM with nits, I guess. > > I guess ...
6 years, 7 months ago (2014-05-05 19:10:05 UTC) #20
darin (slow to review)
I think that's worth pondering, especially as we start to develop tests for validating message ...
6 years, 7 months ago (2014-05-06 03:24:17 UTC) #21
yzshen1
6 years, 7 months ago (2014-05-06 03:44:40 UTC) #22
Yeah, I will pick up the validation work this week, and would be happy to
discuss about the in/out format.

Thanks!


On Mon, May 5, 2014 at 8:24 PM, Darin Fisher <darin@chromium.org> wrote:

> I think that's worth pondering, especially as we start to develop tests
> for validating message payloads. Yuzhu plans to pick up this work. Best to
> chat with him about the details.
>
> -Darin
>
>
> On Mon, May 5, 2014 at 12:10 PM, <tsepez@chromium.org> wrote:
>
>> On 2014/04/29 20:55:00, viettrungluu wrote:
>>
>>> LGTM with nits, I guess.
>>>
>>
>>  I guess we can ponder the test file format some more.
>>>
>>
>> Drive-by:  In the historical past, I've sometimes selected a format for
>> these
>> kinds of tests such that the input and the output format are the same,
>> and human
>> readable.  If you can ingest what you've spewed out, then some things get
>> easier.
>>
>> https://codereview.chromium.org/229683005/
>>
>
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698