]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: backend: check delay MUX before conn_prepare()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 Feb 2026 09:53:21 +0000 (10:53 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 Feb 2026 10:22:55 +0000 (11:22 +0100)
commit55e9c673811983529132c2e46a2fc5289740e55f
tree610bcf60147dccaa90da2050b82fece1215dfa91
parent194a67600e6581c94e72565d4aa00b7e7e3b5131
BUG/MINOR: backend: check delay MUX before conn_prepare()

In connect_server(), when a new connection must be instantiated, MUX
initialization is delayed if an ALPN setting is present on the server
line configuration, as negotiation must be performed to select the
correct MUX. However, this is not the case if the ALPN can already be
retrieved on the server cache.

This check is performed too late however and may cause issue with the
QUIC stack. The problem can happen when the server ALPN is not yet set.
In the normal case, quic_conn layer is instantiated and MUX init is
delayed until the handshake completion. When the MUX is finally
instantiated, it reused without any issue app_ops from its quic_conn,
which is derived from the negotiated ALPN.

However, there is a race condition if another QUIC connection populates
the server ALPN cache. If this happens after the first quic_conn init
but prior to the MUX delay check, the MUX will thus immediately start in
connect_server(). When app_ops is retrieved from its quic_conn, a crash
occurs in qcc_install_app_ops() as the QUIC handshake is not yet
finalized :

  #0  0x000055e242a66df4 in qcc_install_app_ops (qcc=0x7f127c39da90, app_ops=0x0) at src/mux_quic.c:1697
  1697 if (app_ops->init && !app_ops->init(qcc)) {
  [Current thread is 1 (Thread 0x7f12810f06c0 (LWP 25758))]

To fix this, MUX delay check is moved up in connect_server(). It is now
performed prior conn_prepare() which is responsible for the quic_conn
layer instantiation. Thus, it ensures consistency for the QUIC stack :
MUX init is always delayed if the quic_conn does not reuses itself the
SSL session and ALPN server cache (no quic_reuse_srv_params()).

This must be backported up to 3.3.
src/backend.c