Repository navigation
quic: validate maxPayloadSize range - #67531
Open
christianaurichzm wants to merge 1 commit into
Open
christianaurichzm wants to merge 1 commit into
christianaurichzm wants to merge 1 commit into
Conversation
The maxPayloadSize option was copied into ngtcp2's max_tx_udp_payload_size unchecked. ngtcp2 requires 1200 to 65527 and only asserts it, so in a release build 0 gave the congestion controller an empty initial window and the process died with SIGFPE in ngtcp2_cc_cubic_init() when the connection was created. Values from 1 to 1199 were accepted and the session was destroyed before it opened. Reject values outside that range when the session options are parsed, for both connect() and listen(). Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67531 +/- ##
========================================
Coverage 90.68% 90.68%
========================================
Files 799 800 +1
Lines 280314 280461 +147
Branches 54133 54164 +31
========================================
+ Hits 254204 254347 +143
- Misses 16228 16238 +10
+ Partials 9882 9876 -6 🚀 New features to boost your workflow:
|
pimterry
approved these changes
Nov 17, 2026
Collaborator
Collaborator
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.
quic.connect()kills the process withSIGFPEwhenmaxPayloadSizeis0:The option goes unchecked into ngtcp2's
max_tx_udp_payload_size, which must be between 1200 and 65527. ngtcp2 only asserts that, so a release build ends up dividing by zero inngtcp2_cc_cubic_init(). This rejects values outside the range when the session options are parsed, forconnect()andlisten(), and documents it.The new cases in
test/parallel/test-quic-max-payload-size.mjsfail onmainand pass with this change.Refs: #65827