]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: Wrong packet refcount handling in qc_pkt_insert()
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 20 Dec 2021 13:41:19 +0000 (14:41 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 20 Dec 2021 16:33:51 +0000 (17:33 +0100)
commit2ce5acf7edda75ff8f652bcd348fd89b5537ef09
tree8a81dd4825f41d8f4710e18cbea48745d724ed83
parentf1d38cbe152a11a5fafe97ecbcc98aa8df4fa62f
MINOR: quic: Wrong packet refcount handling in qc_pkt_insert()

The QUIC connection I/O handler qc_conn_io_cb() could be called just after
qc_pkt_insert() have inserted a packet in a its tree, and before qc_pkt_insert()
have incremented the reference counter to this packet. As qc_conn_io_cb()
decrement this counter, the packet could be released before qc_pkt_insert()
might increment the counter, leading to possible crashes when trying to do so.
So, let's make qc_pkt_insert() increment this counter before inserting the packet
it is tree. No need to lock anything for that.
src/xprt_quic.c