]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: tcp-checks: always attach the transport before installing the mux
authorWilly Tarreau <w@1wt.eu>
Fri, 31 Jul 2020 06:49:31 +0000 (08:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 31 Jul 2020 06:49:31 +0000 (08:49 +0200)
commit8e979fa74f1433b7d1f80c4d037efa4cafaea11c
tree9d0fee9ca7326a7cf3ef4f9d4d4e702accccb163
parenta3b17563e16ba0dd1dd9a617424fe198d7687bac
BUG/MEDIUM: tcp-checks: always attach the transport before installing the mux

Similarly to the issue described in commit "BUG/MEDIUM: backend: always
attach the transport before installing the mux", in tcpcheck_eval_connect()
we can install a handshake transport layer underneath the mux and replace
its subscriptions, causing a crash if the mux had already subscribed for
whatever reason.

A simple reproducer consists in adding fd_cant_recv() after fd_cant_send()
in tcp_connect_server() and running it on this config, as discussed in issue

  listen foo
    bind :8181
    mode http
    option httpchk
    server srv1 127.0.0.1:8888 send-proxy-v2 check inter 1000

The mux may only be installed *after* xprt_handshake is set up, so that
it registers against it and not against raw_sock or ssl_sock. This needs
to be backported to 2.2 which is the first version using muxes for checks.
src/tcpcheck.c