]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h3: do not access QCS <sd> if not allocated
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Dec 2025 10:18:54 +0000 (11:18 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Dec 2025 14:00:23 +0000 (15:00 +0100)
commita15f0461a016a664427f5aaad2227adcc622c882
treed61b9133fc63b0623ac61327fe5930887dc7d928
parent18625f7ff3de6bd7f3f7dcaa50e11d025012790e
BUG/MEDIUM: h3: do not access QCS <sd> if not allocated

Since the following commit, allocation of QCS stream-endpoint on FE side
has been delayed. The objective is to allocate it only for QCS attached
to an upper stream object. Stream-endpoint allocation is now performed
on qcs_attach_sc() called during HEADERS parsing.

  commit e6064c561684d9b079e3b5725d38dc3b5c1b5cd5
  OPTIM: mux-quic: delay FE sedesc alloc to stream creation

Also, stream-endpoint is accessed through the QCS instance after HEADERS
or DATA frames parsing, to update the known input payload length. The
above patch triggered regressions as in some code paths, <sd> field is
dereferenced while still being NULL.

This patch fixes this by restricting access to <sd> field after newer
conditions.

First, after HEADERS parsing, known input length is only updated if
h3_req_headers_to_htx() previously returned a success value, which
guarantee that qcs_attach_sc() has been executed.

After DATA parsing, <sd> is only accessed after the frame validity
check. This ensures that HEADERS were already parsed, thus guaranteing
that stream-endpoint is allocated.

This should fix github issue #3211.

This must be backported up to 3.3. This is sufficient, unless above
patch is backported to previous releases, in which case the current one
must be picked with it.
src/h3.c