From 68737316eafde34f7053d321cf0eafaa6b690fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 7 Apr 2023 16:28:46 +0200 Subject: [PATCH] BUG/MINOR: quic: Wrong packet number space probing before confirmed handshake It is possible that the handshake was not confirmed and there was no more packet in flight to probe with. It this case the server must wait for the client to be unblocked without probing any packet number space contrary to what was revealed by interop tests as follows: [01|quic|2|uic_loss.c:65] TX loss pktns : qc@0x7fac301cd390 pktns=I pp=0 [01|quic|2|uic_loss.c:67] TX loss pktns : qc@0x7fac301cd390 pktns=H pp=0 tole=-102ms [01|quic|2|uic_loss.c:67] TX loss pktns : qc@0x7fac301cd390 pktns=01RTT pp=0 if=1054 tole=-1987ms [01|quic|5|uic_loss.c:73] quic_loss_pktns(): leaving : qc@0x7fac301cd390 [01|quic|5|uic_loss.c:91] quic_pto_pktns(): entering : qc@0x7fac301cd390 [01|quic|3|ic_loss.c:121] TX PTO handshake not already completed : qc@0x7fac301cd390 [01|quic|2|ic_loss.c:141] TX PTO : qc@0x7fac301cd390 pktns=I pp=0 dur=83ms [01|quic|5|ic_loss.c:142] quic_pto_pktns(): leaving : qc@0x7fac301cd390 [01|quic|3|c_conn.c:5179] needs to probe Initial packet number space : qc@0x7fac301cd390 This bug was not visible before this commit: BUG/MINOR: quic: wake up MUX on probing only for 01RTT This means that before it, one could do bad things (probing the 01RTT packet number space before the handshake was confirmed). Must be backported to 2.7 and 2.6. --- src/quic_conn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/quic_conn.c b/src/quic_conn.c index 06cbcdba7..e76355c9b 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -5245,6 +5245,11 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state) if (qc->path->in_flight) { pktns = quic_pto_pktns(qc, qc->state >= QUIC_HS_ST_CONFIRMED, NULL); + if (!pktns->tx.in_flight) { + TRACE_PROTO("No in flight packets to probe with", QUIC_EV_CONN_TXPKT, qc); + goto out; + } + if (pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL]) { if (qc_may_probe_ipktns(qc)) { qc->flags |= QUIC_FL_CONN_RETRANS_NEEDED;