From 943b9ce4af536a55b5ee7654ecea83d3a232cb28 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 17 Nov 2026 17:55:22 +0100 Subject: [PATCH] BUG/MAJOR: mux-quic: fail on impossible data transfers in rcv_buf() When some data couldn't be transferred from the rxbuf to the channel, leaving the channel empty (e.g. due to the reserve), we must not set SE_FL_WANT_ROOM otherwise we cannot get out of this situation and sc_conn_recv() detects it and panics. Let's just report a stream error for non-fragmentable contents that exceed the maximum size and stop here. This must be backported to all versions. --- src/mux_quic.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index 89770d37f..b41eedb31 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -4523,7 +4523,18 @@ static size_t qcm_strm_rcv_buf(struct stconn *sc, struct buffer *buf, ret = qcs_http_rcv_buf(qcs, buf, count, &fin); if (b_data(&qcs->rx.app_buf)) { - se_fl_set(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM); + if (b_data(buf)) + se_fl_set(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM); + else { + /* we have pending data and the output buf is empty, + * this is typical of too large a non-fragmentable + * data (e.g headers, trailers) combined with a + * reserve, so this will never unblock. + */ + TRACE_STATE("report xfer error", QMUX_EV_STRM_RECV, qcc->conn, qcs); + se_fl_set(qcs->sd, SE_FL_ERROR); + goto leave; + } } else { se_fl_clr(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM); @@ -4584,7 +4595,7 @@ static size_t qcm_strm_rcv_buf(struct stconn *sc, struct buffer *buf, tasklet_wakeup(qcc->wait_event.tasklet); } } - +leave: TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs); return ret; -- 2.47.3