Welcome! Log In Create A New Profile

Advanced

[nginx] QUIC: prevented generating ACK frames with discarded keys.

Sergey Kandaurov
October 20, 2023 10:44AM
details: https://hg.nginx.org/nginx/rev/c80d111340dc
branches:
changeset: 9170:c80d111340dc
user: Sergey Kandaurov <pluknet@nginx.com>
date: Fri Oct 20 18:05:07 2023 +0400
description:
QUIC: prevented generating ACK frames with discarded keys.

Previously it was possible to generate ACK frames using formally discarded
protection keys, in particular, when acknowledging a client Handshake packet
used to complete the TLS handshake and to discard handshake protection keys.
As it happens late in packet processing, it could be possible to generate ACK
frames after the keys were already discarded.

ACK frames are generated from ngx_quic_ack_packet(), either using a posted
push event, which envolves ngx_quic_generate_ack() as a part of the final
packet assembling, or directly in ngx_quic_ack_packet(), such as when there
is no room to add a new ACK range or when the received packet is out of order.
The added keys availability check is used to avoid generating late ACK frames
in both cases.

diffstat:

src/event/quic/ngx_event_quic_ack.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 60c4e8d3151f -r c80d111340dc src/event/quic/ngx_event_quic_ack.c
--- a/src/event/quic/ngx_event_quic_ack.c Fri Oct 20 18:05:07 2023 +0400
+++ b/src/event/quic/ngx_event_quic_ack.c Fri Oct 20 18:05:07 2023 +0400
@@ -907,6 +907,10 @@ ngx_quic_ack_packet(ngx_connection_t *c,
" nranges:%ui", pkt->pn, (int64_t) ctx->largest_range,
ctx->first_range, ctx->nranges);

+ if (!ngx_quic_keys_available(qc->keys, ctx->level, 1)) {
+ return NGX_OK;
+ }
+
prev_pending = ctx->pending_ack;

if (pkt->need_ack) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] QUIC: prevented generating ACK frames with discarded keys.

Sergey Kandaurov 284 October 20, 2023 10:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 261
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready