]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Possible RX packet memory leak under heavy load
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 22 Nov 2023 15:29:08 +0000 (16:29 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Nov 2023 17:03:26 +0000 (18:03 +0100)
This bug could be reproduced with -dMfail and h2load generating plenty of connections.
A "show pools" CLI command showed that some memory in relation with RX packet pool
was never release. Furthermore, adding a RX packet counter to each connection
and a BUG_ON() in quic_conn_release() has proved that this unreleased memory
was in relation with RX packet which were not linked to a connection.

The responsible is quic_dgram_parse() which does not release some RX packet
memory before exiting after the connection thread affinity has changed.

Must be backported as far as 2.7.

src/quic_rx.c

index df4abb5c89b5c0ad9a7c4f8330ce61508e21d34b..3374e1a9b7af2be55b02de4212dbb54858704568 100644 (file)
@@ -2587,6 +2587,7 @@ int quic_dgram_parse(struct quic_dgram *dgram, struct quic_conn *from_qc,
                                        MT_LIST_APPEND(&quic_dghdlrs[new_tid].dgrams,
                                                       &dgram->handler_list);
                                        tasklet_wakeup(quic_dghdlrs[new_tid].task);
+                                       pool_free(pool_head_quic_rx_packet, pkt);
                                        goto out;
                                }