]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: qmux: do not crash on receiving an invalid first frame
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 27 May 2026 13:35:34 +0000 (15:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 27 May 2026 13:38:51 +0000 (15:38 +0200)
With QMux, each peer has to first emit a transport parameters frame. If
the received frame is different, xprt_qmux handshake cannot proceed.
This patch removes the BUG_ON() in this case, replacing it with a safer
connection closure.

In the future, a graceful close with CONNECTION_CLOSE frame should be
implemented.

No need to backport.

src/xprt_qmux.c

index 56e68edba2d2d1f4d5d6e89d40f34ae8e7655fbf..e544f559a01146b229c3cd7b9035da9bbbe41d39 100644 (file)
@@ -106,7 +106,8 @@ int conn_recv_qmux(struct connection *conn, struct xprt_qmux_ctx *ctx, int flag)
                goto fail;
 
        /* TODO close connection with TRANSPORT_PARAMETER_ERROR if frame not present. */
-       BUG_ON(frm.type != QUIC_FT_QX_TRANSPORT_PARAMETERS);
+       if (frm.type != QUIC_FT_QX_TRANSPORT_PARAMETERS)
+               goto fail;
 
        if (!qc_parse_frm_payload(&frm, &pos, end, NULL))
                goto fail;