]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: quic: initialize the members read by quic_conn_release() first
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 16 Nov 2026 16:37:50 +0000 (17:37 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 17 Nov 2026 08:35:15 +0000 (09:35 +0100)
commit2b75c35734215bc8493fea3d1d61542503f2d167
treeec1a1142b92ac3586e423a31ae888abda0ae1b81
parent17a43429681de5b0d1543c16c262029168efe53d
BUG/MINOR: quic: initialize the members read by quic_conn_release() first

qc_new_conn() allocates the CID tree before initializing ->flags, ->state
and ->prx_counters, while quic_conn_release(), called from its error path,
reads all three of them. On allocation failure, the release thus reads
uninitialized memory, and quic_conn_prx_cntrs_update() dereferences an
invalid ->prx_counters instead of returning early. This affects both
frontend and backend connections.

The backend ->prx_counters assignment has the same problem, as it is placed
after the RAND_bytes() call, which is another failure point.

This was introduced by commit b8cb8e1a6 ("BUG/MINOR: quic: fix counters
used on BE side"), which moved the assignment into the per-side branches,
after the first failure point. Move the CID tree allocation after these
initializations, and move the backend ->prx_counters assignment before
RAND_bytes().

Must be backported up to 3.3.
src/quic_conn.c