BUG/MEDIUM: quic: Avoid some crashes upon TX packet allocation failures
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 8 Nov 2023 10:31:21 +0000 (11:31 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Thu, 9 Nov 2023 09:32:31 +0000 (10:32 +0100)
commit819690303de91804e009dea31d1c4c9116666396
tree9ce3edd7d8bdb868f8b20098194d9e63e4ae967a
parentb21e08cbd275fc6da24d1f3f0ec54a96f318c751
BUG/MEDIUM: quic: Avoid some crashes upon TX packet allocation failures

If a TX packet cannot be allocated (by qc_build_pkt()), as it can be coalesced
to another one, this leads the TX buffer to have remaining not sent prepared data.
Then haproxy crashes upon a BUG_ON() triggered by the next call to qc_txb_release().
This may happen only during handshakes.

To fix this, qc_build_pkt() returns a new -3 error to dected such allocation
failures followed which is for now on followed by a call to qc_purge_txbuf() to
send the TX prepared data and purge the TX buffer.

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