Skip to content

http: remove double 100 headers ASSERT from H2 codec. - #4313

Merged
htuch merged 1 commit into
envoyproxy:masterfrom
htuch:remove-100-assert
Sep 6, 2018
Merged

htuch merged 1 commit into
envoyproxy:masterfrom
htuch:remove-100-assert

Conversation

@htuch

@htuch htuch commented Aug 31, 2018

Copy link
Copy Markdown
Member

This ASSERT can be triggered by uncontrolled wire traffic; since we have
sane handling of this behavior, this probably isn't the right thing to
have in place to detect this condition. I.e. we're not violating any
invariant here.

Fixes oss-fuzz issue
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10072.

Risk level: Low
Testing: Corpus entry added.

Signed-off-by: Harvey Tuch [email protected]

This ASSERT can be triggered by uncontrolled wire traffic; since we have
sane handling of this behavior, this probably isn't the right thing to
have in place to detect this condition. I.e. we're not violating any
invariant here.

Fixes oss-fuzz issue
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10072.

Risk level: Low
Testing: Corpus entry added.

Signed-off-by: Harvey Tuch <[email protected]>

@ggreenway ggreenway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @alyssawilk ?

// Even if we have :status 100 in the client case in a response, when
// we received a 1xx to start out with, nghttp2 message checking
// guarantees proper flow here.
stream->decodeHeaders();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree if this can happen, the assert is no good. When you say nghttp2 guarantees proper flow, does it? I believe it's legal to have 100, 100, 200 and I don't think our code handles that at all - not sure if it'd result in a double decode headers or what. Do we have a regression test for that to make sure it doesn't choke in some weird way?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was assuming you had already established this with the previous comment; if not, what was meant here by "nghttp2 message checking guarantees proper flow here"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's Matt's comment not mine :-)
https://github.com/envoyproxy/envoy/pull/562/files

I don't think we have a test case for trying to send 100, 100, 200. Given it's allowed by the spec I am not sure what would happen. Looking at code, think the 200 would be handled as trailers and I have no idea what would happen if there were actually trailers but I was hoping we could fuzz that as well (or just 100, 100, 100 200) to make sure it's nothing bad.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alyssawilk finally got back to looking at this.

TEST_P(Http2CodecImplTest, InvalidRepeatContinue) {
seems to be the test you're after; it does a double :100 and you end up with a stream reset. I'll merge this based on that, LMK if there is more to it than this from your thinking.

@dnoe

dnoe commented Sep 5, 2018

Copy link
Copy Markdown
Contributor

Is this ready to merge or is there more work planned @htuch ?

@htuch

htuch commented Sep 5, 2018

Copy link
Copy Markdown
Member Author

@dnoe I need to investigate further, it's on my TODO list.

@htuch
htuch merged commit b15a0cd into envoyproxy:master Sep 6, 2018
@htuch
htuch deleted the remove-100-assert branch September 6, 2018 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants