]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: Wake the stconn on error when failing to create mux
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Apr 2026 06:07:14 +0000 (08:07 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Apr 2026 06:20:59 +0000 (08:20 +0200)
When the app_ops were removed, direct calls to the SC wake callback function
were replaced by tasklet wakeups. However, in conn_create_mux(), it was
replaced by a direct call to sc_conn_process(). However, sc_conn_process()
is only usable when the SC is attach to a stream. A backend mux can be
created for a healcheck. In this context, sc_conn_process() cannot be
called.

Because of this bug, crashes can be experienced when an error is triggered
during a SSL connection attempt from a healthcheck.

To fix the issue, the call to sc_conn_process() was replaced by a tasklet
wakeup.

This patch should fix the issue #3326. No backport needed.

src/connection.c

index 52a6fb3683cc3fb817dc17cbbe9aca41adb1b8df..e3b8915286344d99a01a8f5ca9a1ad18b1ca4a6e 100644 (file)
@@ -141,7 +141,7 @@ int conn_create_mux(struct connection *conn, int *closed_connection)
 fail:
                /* let the upper layer know the connection failed */
                if (sc) {
-                       sc_conn_process(sc);
+                       tasklet_wakeup(sc->wait_event.tasklet, TASK_WOKEN_MSG);
                }
                else if (conn_reverse_in_preconnect(conn)) {
                        struct listener *l = conn_active_reverse_listener(conn);