]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix decrement of half_open counter on qc alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Nov 2023 09:55:30 +0000 (10:55 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Nov 2023 10:16:41 +0000 (11:16 +0100)
commit78d244e9f7788bdd719ececca1f7e9308416a3b4
treea2b4f6f8e1a11949b1185e26cbbacf01ebf8ef5f
parent92da3accfd2e40fda949a43958d797bf5d5ac07b
BUG/MINOR: quic: fix decrement of half_open counter on qc alloc failure

Half open counter is used to comptabilize QUIC connections waiting for
address validation. It was recently reworked to adjust its scope. With
each decrement operation, a BUG_ON() was added to ensure the counter
never wraps.

This BUG_ON() could be triggered if an allocation fails for one of
quic_conn members in qc_new_conn(). This is because half open counter is
incremented at the end of qc_new_conn(). However, in case of alloc
failure, quic_conn_release() is called immediately to ensure the counter
is decremented if a connection is freed before peer address has been
validated.

To fix this, increment half open counter early in qc_new_conn() prior to
every quic_conn members allocations.

This issue was reproduced using -dMfail argument.

This issue has been introduced by
  commit 278808915b05bab1ff1e08e95fe32be22109719f
  MINOR: quic: reduce half open counters scope

No need to backport.
src/quic_conn.c