]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-quic: fix BUG_ON() on rxbuf alloc error
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 21 May 2025 09:24:57 +0000 (11:24 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 21 May 2025 09:33:00 +0000 (11:33 +0200)
RX buffer allocation has been reworked in current dev tree. The
objective is to support multiple buffers per QCS to improve upload
throughput.

RX buffer allocation failure is handled simply : the whole connection is
closed. This is done via qcc_set_error(), with INTERNAL_ERROR as error
code. This function contains a BUG_ON() to ensure it is called only one
time per connection instance.

On RX buffer alloc failure, the aformentioned BUG_ON() crashes due to a
double invokation of qcc_set_error(). First by qcs_get_rxbuf(), and
immediately after it by qcc_recv(), which is the caller of the previous
one. This regression was introduced by the following commit.

  60f64449fbba7bb6e351e8343741bb3c960a2e6d
  MAJOR: mux-quic: support multiple QCS RX buffers

To fix this, simply remove qcc_set_error() invocation in
qcs_get_rxbuf(). On buffer alloc failture, qcc_recv() is responsible to
set the error.

This does not need to be backported.

src/mux_quic.c

index b335eaecff2ce5f7c5d8317ecdd1a7a07240182c..68377498a15f9ae0ed98c07c24c0f4b042e4aea5 100644 (file)
@@ -1732,7 +1732,6 @@ static struct qc_stream_rxbuf *qcs_get_rxbuf(struct qcs *qcs, uint64_t offset,
        ncbuf = &buf->ncb;
        if (!qcs_get_ncbuf(qcs, ncbuf) || ncb_is_null(ncbuf)) {
                TRACE_ERROR("receive ncbuf alloc failure", QMUX_EV_QCC_RECV|QMUX_EV_QCS_RECV, qcc->conn, qcs);
-               qcc_set_error(qcc, QC_ERR_INTERNAL_ERROR, 0);
                goto err;
        }