]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix crash on qc_new_conn alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Nov 2023 09:54:33 +0000 (10:54 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Nov 2023 10:16:41 +0000 (11:16 +0100)
commit92da3accfd2e40fda949a43958d797bf5d5ac07b
treed47acb5755349357d194128c0d8edee1c1339d5d
parent76acde91076760d760c6384fb2df7a061055e9e6
BUG/MINOR: quic: fix crash on qc_new_conn alloc failure

A new counter was recently introduced to comptabilize the current number
of active QUIC handshakes. This counter is stored on the listener
instance.

This counter is incremented at the beginning of qc_new_conn() to check
if limit is not reached prior to quic_conn allocation. If quic_conn or
one of its inner member allocation fails, special care is taken to
decrement the counter as the connection instance is released. However,
it relies on <l> variable which is initialized too late to cover
pool_head_quic_conn allocation failure.

To fix this, simply initialize <l> at the beginning of qc_new_conn().

This issue was reproduced using -dMfail argument.

This issue was introduced by the following commit
  commit 3df6a60113773d8abff3457c7a06e30c1892b7dc
  MEDIUM: quic: limit handshake per listener

No need to backport.
src/quic_conn.c