Apply weak pointer semantics to streams in HTTP1 codec#44676
Open
reubent-goog wants to merge 4 commits intoenvoyproxy:mainfrom
Open
Apply weak pointer semantics to streams in HTTP1 codec#44676reubent-goog wants to merge 4 commits intoenvoyproxy:mainfrom
reubent-goog wants to merge 4 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Reuben Tanner <reubent@google.com>
Signed-off-by: Reuben Tanner <reubent@google.com>
Contributor
Author
|
/retest |
Contributor
Author
|
CI keeps failing to download dependencies but the tests are passing and this is ready to review |
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: Apply weak pointer semantics to HTTP/1 streams in ServerConnectionImpl and ClientConnectionImpl
Additional Description:
This change applies an existing pattern used to fix use-after-free issues in h2/h3 to both
ServerConnectionImplandClientConnectionImplin the HTTP/1 codec to safely access decoders. We replaced raw pointers toRequestDecoderandResponseDecoderwithRequestDecoderHandlePtrandResponseDecoderHandlePtrrespectively. This allows safe verification of whether the decoder is still valid before attempting to access it. We have also addedENVOY_BUGassertions to catch instances where the decoder is unexpectedly null. After running all tests internally, expectedly, there are no existing instances of the ENVOY_BUGs. Tests have been added/updated for both paths to verify that theENVOY_BUGis triggered as expected when decoders are destroyed before message completion.Disclosure: Used Gen AI to help generate the code and tests
Risk Level: Low (safety improvement using established patterns).
Testing: Updated
ResponseDecoderDestroyedBeforeMessageCompleteand addedRequestDecoderDestroyedBeforeMessageCompleteincodec_impl_test.cc. All tests passed.Docs Changes: None.
Release Notes: None.
Platform Specific Features: None.