[chore] http2: fix integer overflow in unconsumed_bytes_#45974
Open
vishalmore90 wants to merge 1 commit into
Open
[chore] http2: fix integer overflow in unconsumed_bytes_#45974vishalmore90 wants to merge 1 commit into
vishalmore90 wants to merge 1 commit into
Conversation
Signed-off-by: vishal <httpsvishal07@gmail.com>
|
Hi @vishalmore90, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: http2: fix integer overflow in unconsumed_bytes_
Change the type of
unconsumed_bytes_fromuint32_ttouint64_tinConnectionImpl::StreamImplto prevent flow control state corruption due to integer overflow on read-disabled streams.Additional Description:
When a stream is read-disabled, Envoy accumulates the number of unconsumed bytes received on the stream. When the stream is later read-enabled, Envoy reports the accumulated unconsumed bytes back to the HTTP/2 codec to restore the peer's flow control window. Because
unconsumed_bytes_was declared as auint32_t, it could overflow if the peer sent more than 4 GB of data before the stream was read-enabled, leading to connection/stream flow control corruption (stalls or data floods). Changing the type touint64_tprevents this overflow.Risk Level: Low (Simple type conversion, fully backward-compatible)
Testing: Added a unit test
UnconsumedBytesOverflowPreventionincodec_impl_test.ccthat simulates the addition of bytes beyondUINT32_MAXand verifies it doesn't wrap around.Docs Changes: N/A
Release Notes: N/A