]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix use-after-free with trace on ACK consume
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 25 Apr 2022 12:26:54 +0000 (14:26 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 25 Apr 2022 13:01:53 +0000 (15:01 +0200)
commit7586bef6d7fc866659aff9017a644d7f48ba16ce
tree05bac9503f83f412163a0405dc45fe0904240e67
parent3e69fcc240022d90c62aa9aa111c785d7f15c1ce
BUG/MINOR: quic: fix use-after-free with trace on ACK consume

When using qc_stream_desc_ack(), the stream instance may be freed if
there is no more data in its buffers. This also means that all frames
still stored waiting for ACK for this stream are freed via
qc_stream_desc_free().

This is particularly important in quic_stream_try_to_consume() where we
loop over the frames tree of the stream. A use-after-free is present in
cas the stream has been freed in the trace "stream consumed" which
dereference the frame. Fix this by first checking if the stream has been
freed or not.

This bug was detected by using ASAN + quic traces enabled.
src/xprt_quic.c