]> git.kaiwu.me - haproxy.git/commit
REGTESTS: quic: NEW_CONNECTION_ID must not reference a retired CID
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 18 Nov 2026 16:45:37 +0000 (17:45 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 18 Nov 2026 17:00:24 +0000 (18:00 +0100)
commit9236b332d009622010f53fd151a79feabd7c848f
tree23f03aecab9f736554c95eea2b4605213564a2fc
parente55a181e96a9446390bc4c6bf5a5641b326081cc
REGTESTS: quic: NEW_CONNECTION_ID must not reference a retired CID

A NEW_CONNECTION_ID frame stored pointers to the CID and the stateless
reset token of its quic_connection_id. RETIRE_CONNECTION_ID frees that
object at once, while a frame built for it may still be queued, in flight,
or duplicated later for a retransmission: it was then built from freed
memory.

Retiring sequence numbers 1 and 2 in the same packet is enough to reach
it: the second RETIRE frees the CID the first NEW_CONNECTION_ID frame
still points to. With the pool cache, the freed object is handed back to
the next CID of the same connection, so two frames carry the same CID,
which the client detects. Without it (ASan, DEBUG_DONT_SHARE_POOLS), freed
heap content is sent and the sanitizer reports a use-after-free.

The test drives a real handshake through the QUIC client in
reg-tests/quic/qclient, then retires both sequence numbers in one packet,
and checks two things: no duplicate CID is advertised for two different
sequence numbers, and the connection is closed with a transport error of
type PROTOCOL_VIOLATION, as RFC 9000 19.16 requires for a sequence number
that was never sent. A crash instead of the CONNECTION_CLOSE frame leaves
the test waiting, which also fails it.

It needs the Python client, so it carries '#REGTEST_EXTRA=qclient' and
only runs when requested.

Covers 827354038 and a50bb45ba.
reg-tests/quic/retired_cid_ncid.py [new file with mode: 0755]
reg-tests/quic/retired_cid_ncid.vtc [new file with mode: 0644]