BUG/MEDIUM: connection: properly leave stopping list on error
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Jan 2022 16:24:26 +0000 (17:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 26 Jan 2022 03:34:31 +0000 (04:34 +0100)
commitb8c9a5fc68c7fa5e0047b087673b547dd16a7a14
tree63024d952050ff0c75d433eafc3e2a6df43af602
parent86b093a51d35d13555b0e255d0c1e25313682929
BUG/MEDIUM: connection: properly leave stopping list on error

The stopping-list management introduced by commit d3a88c1c3 ("MEDIUM:
connection: close front idling connection on soft-stop") missed two
error paths in the H1 and H2 muxes. The effect is that if a stream
or HPACK table couldn't be allocated for these incoming connections,
we would leave with the connection freed still attached to the
stopping_list and it would never leave it, resulting in use-after-free
hence either a crash or a data corruption.

This is marked as medium as it only happens under extreme memory pressure
or when playing with tune.fail-alloc. Other stability issues remain in
such a case so that abnormal behaviors cannot be explained by this bug
alone.

This must be backported to 2.4.

(cherry picked from commit 3b990fe0bee3072cb70c965c202707cdad0f29cd)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h1.c
src/mux_h2.c