]> git.kaiwu.me - nginx.git/commit
QUIC: always validate stream final size
authorRoman Arutyunyan <arut@nginx.com>
Tue, 28 Jul 2026 14:34:36 +0000 (18:34 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Wed, 29 Jul 2026 16:14:43 +0000 (20:14 +0400)
commit269cdf7806dbab3b69ac99b3f843ad502ba5f6ef
tree19a788a1e89e07bc7ab205b1bfa964285d30af3d
parente3548e3056be59afb2d763533f693d3bc6046917
QUIC: always validate stream final size

As per RFC 9000, Section 4.5:

Once a final size for a stream is known, it cannot change. If a
RESET_STREAM or STREAM frame is received indicating a change in the
final size for the stream, an endpoint SHOULD respond with an error of
type FINAL_SIZE_ERROR.  A receiver SHOULD treat receipt of data at or
beyond the final size as an error of type FINAL_SIZE_ERROR, even after
a stream is closed.

Previously, the stream final size was validated only after other checks
that could return earlier and skip validation: the receive state check
and, for STREAM frames, the check for data below the current receive
offset.  As a result, a STREAM or RESET_STREAM frame carrying a final
size error was silently ignored once the receiving part of the stream
had reached a state in which the frame would otherwise be discarded, or
when a STREAM frame did not advance the receive offset.  Now the final
size is validated first, so a FINAL_SIZE_ERROR is generated in these
cases as well.
src/event/quic/ngx_event_quic_streams.c