-
Notifications
You must be signed in to change notification settings - Fork 844
Fix heap-use-after-free on Http2Stream::destroy() #6346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4e6df85 to
feecbae
Compare
| h2_proxy_ssn->connection_state.release_stream(this); | ||
|
|
||
| cid = _proxy_ssn->connection_id(); | ||
| // Do not access `_proxy_ssn` in below. It might be freed by `release_stream`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks familiar. Don't we have a similar comment somewhere? Or did we remove it and now putting it back? We may want something we can avoid the heap-use-after-free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one? I agree with we need something.
trafficserver/proxy/http2/Http2ConnectionState.cc
Lines 1378 to 1382 in 48bcbe6
| ua_session->destroy(); | |
| // Can't do this because we just destroyed right here ^, | |
| // or we can use a local variable to do it. | |
| // ua_session = nullptr; |
maskit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this fix the issue, but the change makes sense.
zizhong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
Cherry-picked to v9.0.x branch. |
Fix #6345.