]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: h3: fix memory corruption on trailers parsing realign
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 19 Oct 2026 15:01:46 +0000 (17:01 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 20 Oct 2026 12:27:35 +0000 (14:27 +0200)
commit803437cb83e9518173ef1200d30f4925e24f5d90
treedd6bc08d3f9a4f5f0683297642aa5feb6e4229c1
parent385a72f0f28d45d4835ea36ebf542ffc662e634b
BUG/MEDIUM: h3: fix memory corruption on trailers parsing realign

Since 3.0, intermediary QCS Tx buffer has been removed to reduce data
copy. Now, QCS buffer is shared with the transport layer. This brought
some constraints as buffer realign must not be performed if there is
data already sent not yet ACKed. Data encoding function has been adapted
to remove unsafe realign. However, this was not the case for trailers
encoding, which still perform a blind b_slow_realign().

If there is data still present in the buffer when parsing a trailers
frame, this operation will result in memory corruption when
acknowledgement will be received and incorrect buffer data deleted.

This patch fixes h3_resp_trailers_send() to ensure the correct realign
API is used, similar to what is already implemented for data. This is
based on qcc_realign_stream_txbuf() which is the safe method for content
realign.

This must be backported up to 3.0.
src/h3.c