]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MAJOR: mux-quic: do not crash on connection error after glitch threshold
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 6 Oct 2026 16:18:49 +0000 (18:18 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 19 Oct 2026 14:04:04 +0000 (16:04 +0200)
When a glitch reported by the HTTP/3 parser (SETTINGS/GOAWAY parsing or
QPACK decoding error) reaches tune.quic.{fe,be}.sec.glitches-threshold,
_qcc_report_glitch() sets a connection error before the caller also
calls qcc_set_error() with h3c->err. The BUG_ON() on double call then
kills the process, remotely triggerable by any client.

Make qcc_set_error() keep the first error and ignore subsequent calls.

Introduced by commit 0d35f8d91 ("MINOR: h3: report glitch on RFC
violation") in 3.0-dev12. Must be backported to all stable versions
since 3.0.

src/mux_quic.c

index 69315cba34f4b4f19aeed68d3d5643aa58d62c53..fa366d341f8621ed2cd2136f693b1d11452cd765 100644 (file)
@@ -823,14 +823,14 @@ void qcc_notify_buf(struct qcc *qcc, uint64_t free_size)
 
 /* A fatal error is detected locally for <qcc> connection. It should be closed
  * with a CONNECTION_CLOSE using <err> code. Set <app> to true to indicate that
- * the code must be considered as an application level error. This function
- * must not be called more than once by connection. If <tevt> is non null, it
- * is used as a connection level termination event code.
+ * the code must be considered as an application level error.
  */
 void qcc_set_error(struct qcc *qcc, int err, int app, int tevt)
 {
-       /* This must not be called multiple times per connection. */
-       BUG_ON(qcc->flags & QC_CF_ERRL);
+       if (qcc->flags & QC_CF_ERRL) {
+               TRACE_STATE("connection already on error", QMUX_EV_QCC_ERR, qcc->conn);
+               return;
+       }
 
        TRACE_STATE("connection on error", QMUX_EV_QCC_ERR, qcc->conn);