From: Amaury Denoyelle Date: Fri, 13 Nov 2026 15:09:03 +0000 (+0100) Subject: BUG/MINOR: quic: remove CID on BE conn alloc failure X-Git-Tag: v3.5-dev13~82 X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=1078013590e26ca1c3e0ca265a38b018638de05d;p=haproxy.git BUG/MINOR: quic: remove CID on BE conn alloc failure A QUIC backend connection is instantiated in qc_conn_init() via xprt_quic. First, a random CID is generated and inserted into the tree. On success, the quic-conn instance is allocated. If the allocation fails, the CID is freed but not removed from the global CID tree. This may cause a UAF issue later. Fix this by removing the CID from the tree prior to freeing it. This must be backported up to 3.3. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index c2519fe8e..6a43c707f 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -167,6 +167,7 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx) qc = qc_new_conn(srv, NULL, NULL, conn, conn_id, NULL, &srv->addr); if (!qc) { + quic_cid_delete(conn_id); pool_free(pool_head_quic_connection_id, conn_id); goto out; }