]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux_quic: prevent uaf on fctl frame after send error
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 8 Oct 2026 14:07:02 +0000 (16:07 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 16 Oct 2026 08:01:41 +0000 (10:01 +0200)
commitaf8d79f2a6dad02ade9584a1190fbef1f771675a
treeee211053edc0d873f0dea46710537764b69416db
parent73ebe0b3b4458767aaa4fe03dc99c1309f2daf04
BUG/MEDIUM: mux_quic: prevent uaf on fctl frame after send error

When performing emission in QUIC MUX, flow control frames are emitted
first via qcc_emit_fctl(), with a single frame per packet. Emission is
interrupted if an error is returned by the transport layer via
qcc_send_frames().

For each successful MAX_STREAM_DATA frame emission, <msd_frm> pointer of
QCS must be reset. This is necessary as the frame ownership moved to the
transport layer.

Previously, in case of qcc_send_frames() error, input frame was
reinserted in the MUX send list and QCS ownership of the frame would
remain. This is incorrect though in case of a transient error (for
example EAGAIN), as transport layer now owns the frame as it is
responsible to retry emission later. When the frame is finally emitted
and freed by the transport layer, an UAF may occur when QCS flow control
is updated.

This bug occurs with connection owned sockets only. This is because
transient socket errors are simply ignored when using the listener
socket.

To fix this, rewrite qcc_emit_fctl() error path. Cleanup of <msd_frm> is
now performed systematically if frame input list is empty. The function
is then still interrupted if qcc_send_frames() returned an error.

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