]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: mux-quic: prevent crash on QCS already set for purging
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 5 Oct 2026 08:57:22 +0000 (10:57 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Oct 2026 14:49:46 +0000 (16:49 +0200)
commitc7b2c7c671e243fcc8fb85217e9febc120eb610f
treee6f30118e459e75b215deea9875e49bb7705796c
parent306db36ec01ba6268574092b5e38c7a2cb5d1695
BUG/MAJOR: mux-quic: prevent crash on QCS already set for purging

QCC connection has a purge list member. It contains QCS instances
considered as completed, whiches will be freed during the next tasklet
run. Such QCS are reported via qcs_is_completed() helper function.

QCS member <el_send> is used for purge list storage. It is also used for
send list, however an inactive QCS should not be present in the latter.
To enforce this rule, a BUG_ON() is present before purge list insertion
in qcs_close_remote(). This would also be triggered if QCS was already
inserted in the purge list before remote closing.

This BUG_ON() may be triggered when a QCS is scheduled for purge while
it still contains stom data to read. When the final read is performed,
crash will occur in qcs_close_remote(). This happens with detached QCS
only, as they are considered as completed even if only closed locally.

To prevent this situation, add an early return in qcs_close_remote() :
if QCS is already considered completed, do not change its state to fully
closed. As stated above, this only occur for detached QCS instances. The
main objective is to prevent the BUG_ON() crash while still preventing
double insert. As an added value, it guarantees that QCS state remains
constant once scheduled for purge.

Thanks to Brendon C. <bren@bren.win> for his detailled report on the
issue.

This must be backported up to 3.2, after a period of observation.
src/mux_quic.c