From: Amaury Denoyelle Date: Wed, 9 Oct 2024 10:03:36 +0000 (+0200) Subject: BUG/MINOR: quic: fix discarding of already stored out-of-order ACK X-Git-Tag: v3.1-dev10~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0049d0748542153266ff9eb5620d2a7929eb103;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: fix discarding of already stored out-of-order ACK To properly decount out-of-order acked data range, contiguous or overlapping ranges are first merged before their insertion in a tree. The first step ensure that a newly reported range is not completely covered by the existing tree ranges. However, one of the condition was incorrect. Fix this to ensure that the final range tree does not contain duplicated entry. The impact of this bug is unknown. However, it may have allowed the insertion of overlapping ranges, which could in turn cause an error in QUIC MUX txbuf window, with a possible transfer freeze. No need to backport. --- diff --git a/src/quic_stream.c b/src/quic_stream.c index 03a32bd35a..7f06d63eb3 100644 --- a/src/quic_stream.c +++ b/src/quic_stream.c @@ -178,7 +178,7 @@ static int qc_stream_buf_store_ack(struct qc_stream_buf *buf, ack_less = eb64_entry(less, struct qc_stream_ack, offset_node); /* Ensure that offset:len range has not been already acknowledged, at least partially. */ - if ((ack_more && offset == ack_more->offset_node.key && offset + len <= ack_more->offset_node.key) || + if ((ack_more && offset == ack_more->offset_node.key && offset + len <= ack_more->offset_node.key + ack_more->len) || (ack_less && ack_less->offset_node.key + ack_less->len >= offset + len)) { newly_acked = 0; goto end;