]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream: Prevent mux upgrades if client connection is no longer ready
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Aug 2024 13:42:22 +0000 (15:42 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Aug 2024 14:38:20 +0000 (16:38 +0200)
commite4812404c541018ba521abf6573be92553ba7c53
tree3ed8dbc1b53cf8618661ee5b9da33bcada98fd62
parent4ef5251c44b83ed2f9495d200827f8696f16cd60
BUG/MEDIUM: stream: Prevent mux upgrades if client connection is no longer ready

If an early error occurred on the client connection, we must prevent any
multiplexer upgrades. Indeed, it is unexpected for a mux to be initialized
with no xprt. On a normal workflow it is impossible. So it is not an
issue. But if a mux upgrade is performed at the stream level, an early error
on the connection may have already been handled by the previous mux and the
connection may be already fully closed. If the mux upgrade is still
performed, a crash can be experienced.

It is possible to have a crash with an implicit TCP>HTTP upgrade if there is no
data in the input buffer. But it is also possible to get a crash with an
explicit "switch-mode http" rule.

It must be backported to all stable versions. In 2.2, the patch must be
applied directly in stream_set_backend() function.
src/stream.c