BUG/MINOR: quic: Possible leak of TX packets under heavy load
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 22 Nov 2023 13:57:28 +0000 (14:57 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Nov 2023 17:03:26 +0000 (18:03 +0100)
commitcd225da46ca47d3fc62ecc9012fc54dc6aa49b34
treec91969f74b312759996b6ead4cb9251e9a7dbe17
parentdc8a20b3170206932130c5779631a6594a277ab4
BUG/MINOR: quic: Possible leak of TX packets under heavy load

This bug could be reproduced with -dMfail and detected added a counter of TX packet
to the QUIC connection. When released calling quic_conn_release() the connection
should have a null counter of TX packets. This was not always the case.
This could occur during the handshake step: a first packet was built, then another
one should have followed in the same datagram, but fail due to a memory allocation
issue. As the datagram length and first TX packet were not written in the TX
buffer, this latter could not really be purged by qc_purge_tx_buf() even if
called. This bug occured only when building coalesced packets in the same datagram.

To fix this, write the packet information (datagram length and first packet
address) in the TX buffer before purging it.

Must be backported as far as 2.6.
src/quic_tx.c