BUG/MEDIUM: quic: fix sslconns on quic_conn alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 6 Nov 2023 16:47:17 +0000 (17:47 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 7 Nov 2023 13:06:02 +0000 (14:06 +0100)
commit6f9b65f952c7435d6bdb61ba547c0b56a32e2c0a
treedf667dc113022366ffb07685333b798c70c8c3c6
parenta7ba679fe7b6511133441b3250e53a03ace7ed92
BUG/MEDIUM: quic: fix sslconns on quic_conn alloc failure

QUIC connections are accounted inside global sslconns. As with QUIC
actconn, it suffered from a similar issue if an intermediary allocation
failed inside qc_new_conn().

Fix this similarly by moving increment operation inside qc_new_conn().
Increment and error path are now centralized and much easier to
validate.

The consequences are similar to the actconn fix : on memory allocation
global sslconns may wrap, this time blocking any future QUIC or SSL
connections on the process.

This must be backported up to 2.6.
include/haproxy/quic_ssl.h
src/quic_conn.c
src/quic_rx.c