Skip to content
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

Quic: prevent invalid stream frame retransmissions #230

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

nandsky
Copy link
Contributor

@nandsky nandsky commented Sep 30, 2024

There is no need to resend stream frames if the corresponding stream has already been closed.

@arut arut self-assigned this Oct 3, 2024
@arut arut force-pushed the ignore_invalid_stream_frame branch from 6f44705 to 4ab1fda Compare October 3, 2024 13:18
Copy link
Contributor

@arut arut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quic: prevent invalid stream frame retransmissions
Please change the prefix to QUIC: and add a dot at the end.

One possible scenario how this can happen is when a RESET_STREAM was sent by nginx and received by the client. Then the stream was deleted. After that one of prior STREAM frames was lost and retransmitted. While this does not look like something terrible, RFC 9000 explicitly prohibits this in Section 19.4:

After sending a RESET_STREAM, an endpoint ceases transmission and retransmission of STREAM frames on the identified stream.

I suggest the following commit message:

QUIC: prevent deleted stream frame retransmissions.

Since [1], stream frames no longer need to be retransmitted after it was deleted.
The frames which were retransmitted before, could be stream data frames sent prior
to a RESET_STREAM. Such retransmissions are explicitly prohibited by RFC 9000,
Section 19.4.

[1] https://github.com/nginx/nginx/commit/a2a513b93caeba13e408bfc80f8626f49550be40

Comment on lines 638 to 639
ngx_quic_free_frame(c, f);
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra indents here.

@nandsky nandsky force-pushed the ignore_invalid_stream_frame branch from 4ab1fda to 15adc0d Compare October 3, 2024 15:57
@nandsky
Copy link
Contributor Author

nandsky commented Oct 3, 2024

@arut thanks and I have addressed the review comments.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Since a2a513b, stream frames no longer need to be retransmitted after it
was deleted.  The frames which were retransmitted before, could be stream data
frames sent prior to a RESET_STREAM. Such retransmissions are explicitly
prohibited by RFC 9000, Section 19.4.
@arut arut force-pushed the ignore_invalid_stream_frame branch from 15adc0d to b17573b Compare October 8, 2024 15:51
Copy link
Contributor

@arut arut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@arut arut merged commit 3f6d94d into nginx:master Oct 8, 2024
1 check passed
@nandsky nandsky deleted the ignore_invalid_stream_frame branch October 11, 2024 11:58
@Maryna-f5 Maryna-f5 added this to the nginx-1.27.3 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants