]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: quic: do not ACK packet with STREAM if MUX not present
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Apr 2022 13:57:49 +0000 (15:57 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Apr 2022 14:15:47 +0000 (16:15 +0200)
If a packet contains a STREAM frame but the MUX is not allocated, the
frame cannot be enqueued. According to the RFC9000, we must not
acknowledge the packet under this condition.

This may prevents a bug with firefox which keeps trying on refreshing
the web page. This issue has already been detected before closing state
implementation : haproxy wasn't emitted CONNECTION_CLOSE and keeps
acknowledge STREAM frames despite not handle them.

In the future, it might be necessary to respond with a CONNECTION_CLOSE
if the MUX has already been freed.

src/xprt_quic.c

index 15bcd387bf9464ec64dfd6d1c08a2f4210107caf..844aa13eada5358cd40d9d2718e20150ca30d02a 100644 (file)
@@ -2738,9 +2738,12 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct
                        } else if (!(stream->id & QUIC_STREAM_FRAME_ID_INITIATOR_BIT))
                                goto err;
 
-                       /* At the application layer the connection may have already been closed. */
+                       /* The upper layer may not be allocated.
+                        *
+                        * TODO emit a CONNECTION_CLOSE if mux already freed.
+                        */
                        if (qc->mux_state != QC_MUX_READY)
-                               break;
+                               goto err;
 
                        if (!qc_handle_strm_frm(pkt, stream, qc))
                                goto err;