From f0049d0748542153266ff9eb5620d2a7929eb103 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 9 Oct 2024 12:03:36 +0200 Subject: [PATCH] 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. --- src/quic_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quic_stream.c b/src/quic_stream.c index 03a32bd35..7f06d63eb 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; -- 2.47.3