]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: stconn: don't set the type before allocation succeeds
authorWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:45:41 +0000 (19:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:58:38 +0000 (19:58 +0100)
commite2f7946339b539035b64f23912a227af98e4a609
tree419f3010a232d9d5336b29dfe6cefc8a5cd38941
parent389ab0d4b4031c1a7f05fe1b4607f31737b5b9b9
BUG/MEDIUM: stconn: don't set the type before allocation succeeds

There's an occasional crash that can be triggered in sc_detach_endp()
when calling conn->mux->detach() upon memory allocation error. The
problem in fact comes from sc_attach_mux(), which doesn't reset the
sc type flags upon tasklet allocation failure, leading to an attempt
at detaching an incompletely initialized stconn. Let's just attach
the sc after the tasklet allocation succeeds, not before.

This must be backported to 2.6.
src/stconn.c