-
Notifications
You must be signed in to change notification settings - Fork 4.6k
transport: http2 server must validates header list size when early aborting stream #8769
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8769 +/- ##
==========================================
- Coverage 83.42% 83.38% -0.05%
==========================================
Files 419 419
Lines 32556 32576 +20
==========================================
+ Hits 27161 27162 +1
- Misses 4015 4028 +13
- Partials 1380 1386 +6
🚀 New features to boost your workflow:
|
|
@eshitachandwani: I'm moving this to @arjan-bal for second review as he was the one who filed the issue in the first place. |
| contentSubtype: s.contentSubtype, | ||
| status: status.New(codes.Internal, errMsg), | ||
| rst: !frame.StreamEnded(), | ||
| maxSendHeaderListSize: t.maxSendHeaderListSize, |
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 believe the controlBuf.mu mutex needs to be held while accessing t.maxSendHeaderListSize since the value can be updated while handling an HTTP/2 Settings frame from the peer. For the Settings to take effect, the server need to send a Settings ACK frame to the peer. The FIFO ordering of the controlbuf ensures that last ACKed settings are always respected.
I suggest using t.controlBuf.executeAndPut with a callback that validates the header size and enqueues earlyAbortStream if validation passes. If validation fails, call t.closeStream to close the stream with a RST frame. Let me know if this adds too much complexity.
Modifies
earlyAbortStreamHandlerto include check the header list size when early aborting, and returns a RST_STREAM if the max size is exceeded.Fixes #8766
RELEASE NOTES: