From: Amaury Denoyelle Date: Fri, 27 Nov 2026 15:54:35 +0000 (+0100) Subject: BUG/MINOR: mux-quic: fix crash on frame alloc failure after glitch error X-Git-Url: https://git.kaiwu.me/http/%22../$%7BGITURL%7D/static/%7B@url%7D?a=commitdiff_plain;h=cacc949f5c60bafcfa9b703152a0223227b45337;p=haproxy.git BUG/MINOR: mux-quic: fix crash on frame alloc failure after glitch error App layer rcv_buf callback may report a connection error using qcc_set_error(). A negative return value must be used to abort remaining processing in qcc_decode_qcs(). However, this was not the case when the connection was set on error because of the glitch level counter. Some work is thus still being executed, most notably the stream and connection flow-control accounting via qcs_consume(). This is suboptimal as the connection will soon be released. Worse, this may cause a crash if a flow-control frame allocation fails, as qcc_set_error() is called again. This is forbidden and a BUG_ON() is used to catch it. Add a check on the new QC_CF_GLITCH flag after rcv_buf(). If set, qcc_decode_qcs() is interrupted and qcs_consume() is skipped, so that the connection can be quickly released. This must be backported up to 3.0. It relies on the following patch. a4ae233d42315a77dec78fc573ab606748f9dcaf MINOR: mux-quic: add conn flag on glitch error set --- diff --git a/src/mux_quic.c b/src/mux_quic.c index e4a515bc0..ce7ba7d38 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1516,8 +1516,16 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs) if (!(qcs->flags & QC_SF_READ_ABORTED)) { ret = qcc->app_ops->rcv_buf(qcs, &b, fin); - if (qcc->glitches != prev_glitches && !(qcc->flags & QC_CF_IS_BACK)) - session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches); + if (qcc->glitches != prev_glitches) { + if (!(qcc->flags & QC_CF_IS_BACK)) + session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches); + + if (qcc->flags & QC_CF_GLITCH) { + TRACE_ERROR("glitch level counter hit", QMUX_EV_QCS_RECV, qcc->conn, qcs); + ret = -1; + goto err; + } + } if (ret < 0) { TRACE_ERROR("decoding error", QMUX_EV_QCS_RECV, qcc->conn, qcs);