]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: quic-be: do not initialize ->conn too early
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 20 Aug 2025 13:36:18 +0000 (15:36 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 20 Aug 2025 14:25:51 +0000 (16:25 +0200)
commitca5511f02272bb57504539fb8a297fe6a2e446be
tree3954b1c56b4ac34e70ef8d03c6a999993850244a
parent851464784902d4a125c610aea0ec81a8bb07d460
BUG/MEDIUM: quic-be: do not initialize ->conn too early

This bug arrived with this commit:

   BUG/MEDIUM: quic: do not release BE quic-conn prior to upper conn

which added a BUG_ON(qc->conn) statement at the beginning of quic_conn_release().
It is triggered if the connection is not released before releasing the quic_conn.
But this is always the case for a backend quic_conn when its allocation from
qc_new_conn() fails.

Such crashes could be reproduced with -dMfail option. To reach them, the
memory allocations must fail. So, this is relatively rare, except on systems
with limited memory.

To fix this, simply set ->conn quic_conn struct member to a not null value
(the one passed as parameter) after the quic_conn allocation has succeeded.

No backport needed.
src/quic_conn.c