]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http-ana: Reset request flag about data sent to perform a L7 retry
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 Nov 2024 09:01:41 +0000 (10:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Nov 2024 13:46:38 +0000 (14:46 +0100)
commit62f37801c881f68060cedb7a74b5b8cb5fcfec81
tree59bd0a5a956294732c073228765ec9db7f153c07
parent9d4c26ebaa5c54714eae27a39422e0d47970c628
BUG/MEDIUM: http-ana: Reset request flag about data sent to perform a L7 retry

It is possible to loose the request after several L7 retries, leading to
crashes, because the request channel flag stating some data were sent is not
properly reset.

When a L7 retry is performed, some flags on different entities must be reset
to be sure a new connection will be properly retried, just like it was the
first one, mainly because there was no connection establishment failure. One
of them, on the request channel, is not reset. The flag stating some data
were already sent. It is annoying because this flag is used during the
connection establishment to know if an error is triggered at the connection
level or at the data level. In the last case, the error must be handled by
the HTTP response analyzer, to eventually perform another L7 retry.

Because CF_WROTE_DATA flag is not removed when a L7 retry is performed, a
subsequent connection establishment error may be handled as a L7 error while
in fact the request was never sent. It also means the request was never
saved in the buffer used to performed L7 retries. Thus, on the next L7
retires, the request is just lost. This forecefully leads to a bunch of
undefined behavior. One of them is a crash, when the request is used to
perform the load-balancing.

This patch should fix issue #2793. It must be backported to all stable
versions.
src/http_ana.c