Repository navigation
http: guard against multiple 100 responses - #2567
mattklein123 merged 8 commits into
Conversation
Signed-off-by: Alyssa Wilk <[email protected]>
…100_continue Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
|
@alyssawilk at a high level LGTM. I wouldn't mark "Fixes #2563" until we fully protect against multiple informational headers from upstream (wasn't sure if you meant a follow up in this PR, or in another PR). |
|
Fair. Just to sanity check we're fine just resetting the stream on multiple non-informational headers with a comment that we'll add support iff anyone wants to pick it up? |
Absolutely. Or even just ignore them. Either way. |
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
|
(New unit test for the "don't crash on lots of headers" plus verified the ASAN use-after-free crash turns into a reset stream) |
mattklein123
left a comment
There was a problem hiding this comment.
nice, two small comments.
| // supports. Even if this is valid HTTP (something like 103 early hints) fail here | ||
| // rather than trying to push unexpected headers through the Envoy pipeline as that | ||
| // will likely result in Envoy crashing. | ||
| throw CodecProtocolException("Unexpected 'trailers' with no end stream."); |
There was a problem hiding this comment.
WDYT about resetting the stream vs. throwing a codec protocol exception? The latter will tear down the entire connection? I think it's probably not a big deal either way but throwing it out there. Whatever we do I think we should add a stat for this case similar to the headers_cb_no_stream_ stat so we have something to look at just in case.
There was a problem hiding this comment.
I think it would be cleaner, but with the defered reset logic I'd be uncomfortable doing that without a regression test, which I think require a bunch more plumbing to allow the codec client to bypass some of our asserts. I think I'll add a comment explaining that killing the connection, while suboptimal, is better than a crash and safer than a reset.
There was a problem hiding this comment.
Oh and added a stat but I'm totally failing to find where the h2 codec stats are documented. Pointers appreciated.
| EXPECT_CALL(response_decoder_, decodeHeaders_(_, false)); | ||
| response_encoder_->encodeHeaders(early_hint_headers, false); | ||
|
|
||
| EXPECT_THROW(response_encoder_->encodeHeaders(early_hint_headers, false), CodecProtocolException); |
There was a problem hiding this comment.
nit: It's a little hard to tell whether this is throwing when encodeHeaders is called, or when we process on the other side. Is it possible to disable byte transfer temporarily and then check for an exception when we parse bytes on the other side?
There was a problem hiding this comment.
Switching to EXPECT_THROW_WITH_MESSAGE which I think makes it clear where the exception is coming from. WDYT?
Just to make sure I understand, that's a manual verification right? (When you remove the other fix). There isn't a test that covers this? That's fine, I just want to make sure I'm not missing something. |
|
Yeah, exactly, with my new fix in there's no current way to integration
test so I manually integration tested and then added a unit test for real
regression testing.
…On Mon, Feb 12, 2018 at 2:46 PM, Matt Klein ***@***.***> wrote:
plus verified the ASAN use-after-free crash turns into a reset stream
Just to make sure I understand, that's a manual verification right? (When
you remove the other fix). There isn't a test that covers this? That's
fine, I just want to make sure I'm not missing something.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2567 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARYFvcBHHwkH6cINUpHU95qu8PSdoj3bks5tUJUxgaJpZM4R_YUN>
.
|
Signed-off-by: Alyssa Wilk <[email protected]>
mattklein123
left a comment
There was a problem hiding this comment.
LGTM. We probably don't have docs for the h2 specific stats if you searched and you didn't find them. :(
Not sure of the best place to put them. I would just pick a place or just open an issue to track they are missing. Thanks for thinking of the docs!
| COUNTER(header_overflow) \ | ||
| COUNTER(trailers) \ | ||
| COUNTER(headers_cb_no_stream) | ||
| COUNTER(headers_cb_no_stream) \ |
Signed-off-by: Alyssa Wilk <[email protected]>
* Add test for stats+metadata exchange filter for http Cleanup ports Format http server Add ability to add client and server yaml files that test finally uses Add more validation for source and destination app in http test Upgrade to latest envoy-wasm Fix failures in tests Fix lint errors Fix lint errors Fix tests Fix tests * Add destination_port in stats config
Risk Level: low (test only) Testing: yes Docs Changes: n/a Release Notes: n/a Fixes #2546 Signed-off-by: Alyssa Wilk <[email protected]> Signed-off-by: JP Simard <[email protected]>
Risk Level: low (test only) Testing: yes Docs Changes: n/a Release Notes: n/a Fixes #2546 Signed-off-by: Alyssa Wilk <[email protected]> Signed-off-by: JP Simard <[email protected]>
Description:
If not proxying 100-Continue, swallow 100-continues.
Also handle the case of multiple continues headers "cleanly" by resetting the stream, rather than crashing. Support for responses with multiple headers, such as 103 (early hint) can be added when there's a need.
Risk Level: Medium (on top of a high risk feature)
Testing: Lots and lots of extended integration tests.
Docs Changes: envoyproxy/data-plane-api#492
Release Notes: 100-continue support already docced.
Fixes #2563