BUG/MEDIUM: connections: Report connection closing in conn_create_mux()
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 30 Apr 2025 11:19:38 +0000 (13:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:43 +0000 (17:01 +0200)
commitc942bb9c88a40265d308b42fcba59ef61ea0d4e6
treeb8026b6d0f9f842f787a45035b588955982a0ce7
parentcad223e19946a6d02261a259c2be5c20096ef2cd
BUG/MEDIUM: connections: Report connection closing in conn_create_mux()

Add an extra parametre to conn_create_mux(), "closed_connection".
If a pointer is provided, then let it know if the connection was closed.
Callers have no way to determine that otherwise, and we need to know
that, at least in ssl_sock_io_cb(), as if the connection was closed we
need to return NULL, as the tasklet was free'd, otherwise that can lead
to memory corruption and crashes.
This should be backported if 9240cd4a2771245fae4d0d69ef025104b14bfc23
is backported too.

(cherry picked from commit b138eab302531bc40248337132ac01a541a111be)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/connection.h
src/backend.c
src/connection.c
src/ssl_sock.c
src/xprt_handshake.c