]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: ssl: fix trace crash on FE conn release in io cb
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 5 Oct 2026 15:42:18 +0000 (17:42 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Oct 2026 09:08:10 +0000 (11:08 +0200)
The following patch has added an output parameter in conn_create_mux()
to report if the connection has been destroyed. This can happen for
frontend connection only.

In case the connection is destroyed, tasklet is set to NULL as expected
to avoid returning an invalid pointer. However, conn pointer is left
unchanged. This leads to a crash if traces are activated. The proper fix
is to also set conn to NULL.

This must be backported up to 3.2.

src/ssl_sock.c

index fabb0b5ff64b56e8fe47124cee2728cf88287d81..d45547eb4e76e3d6039094ebbd308107ec717004 100644 (file)
@@ -7451,8 +7451,10 @@ struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned int state)
                                if (ret < 0)
                                        closed_connection = 1;
                        }
-                       if (closed_connection)
+                       if (closed_connection) {
+                               conn = NULL;
                                t = NULL;
+                       }
                        goto leave;
                }
        }