]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: quic: crash on key update phase change after a failed one
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 31 Aug 2026 12:26:25 +0000 (14:26 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 31 Aug 2026 16:33:17 +0000 (18:33 +0200)
commitb16b2a2af0b8a5c0d4112f4d9f64937b65129d89
treec96f9c4de2dc6077b86844be4228fb93eea5943d
parentcb1eebf9d985a2100c6eff4368cde539d89fd845
BUG/MEDIUM: quic: crash on key update phase change after a failed one

qc_pkt_decrypt() decrypts the first packet of a new key phase with
<qc->ku.nxt_rx.ctx> without checking it. quic_tls_key_update() leaves it NULL
when the derivation fails on a memory allocation error, and its caller only
dropped the packet, so the next key phase change crashed the process.

Closing the connection would be excessive: <tls_ctx->rx.ctx> is still valid and
the current key phase works. The next keys are now checked where they are used
and derived again if missing. <qc->ku.nxt_tx.ctx> is checked too, as
quic_tls_rotate_keys() moves it to <tls_ctx->tx.ctx>. If the derivation fails
again the packet is dropped and the peer retransmits it. A packet which
decrypted correctly is no longer dropped either.

This bug was introduced by commit a7d2c0946 ("MINOR: quic: Enable the Key
Update process").

Thanks to Bruno Henc for reporting this issue.

This must be backported as far as 2.6.
src/quic_rx.c