]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: session: don't release a reversed connection twice on error
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Aug 2026 07:27:02 +0000 (09:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 12:12:19 +0000 (14:12 +0200)
commit30103ca7a233453d0dd857aa7db22e8cfcccedc8
treee3f075f79fa580dbb72eecbaec5ffc20b1836b27
parent2d74dd7e9eb76dc50513f2b12f513e215de1bea4
BUG/MEDIUM: session: don't release a reversed connection twice on error

A reversed rhttp connection already has its mux installed when it
reaches session_accept_fd(). If an error occurs after setup (e.g. a
"tcp-request connection reject" rule, or conn_xprt_start() failing),
the error path calls session_free(), which destroys the mux and thus
releases the connection. Control then reaches out_free_conn, which
calls conn_release() on it a second time, causing a crash.

Stop after session_free() when the connection has a mux, since it's
already handled. The listener still needs explicit release.

This dates back to reverse-http's introduction in 3.0 (12c40c25a,
"MEDIUM: rhttp: create session for active preconnect"). Must be
backported to 3.0.

Reported-by: Claude (ANT-2026-WNWQ4RGC)
src/session.c