BUG/MEDIUM: quic: reset padding when building GSO datagrams

qc_prep_pkts() encodes input data into QUIC packets in a loop into one
or several datagrams. It supports GSO which requires to built a serie of
multiple datagrams of the same length.

Each packet encoding is performed via a call to qc_do_build_pkt(). This
function has an argument to specify if output packet must be completed
with a PADDING frame. This option is activated when qc_prep_pkts()
encodes the last packet of a datagram with at least one INITIAL packet
in it.

Padding is resetted each time a new datagram is started. However, this
was not performed if GSO is used to built the next datagram. This patch
fixes it by properly resetting padding in this case also.

The impact of this bug is unknown. It may have several effectfs, one of
the most obvious being the insertion of unnecessary padding in packets.
It could also potentially trigger an infinite loop in qc_prep_pkts(),
although this has never been encountered so far.

This must be backported up to 3.1.
This commit is contained in:
Amaury Denoyelle 2025-08-12 17:27:03 +02:00
parent 0dc8d8d027
commit fc3ad50788

View File

@ -818,7 +818,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
*/
prv_pkt = cur_pkt;
dglen = 0;
padding = 0;
}
else {
/* Finalize current datagram if not all frames sent. */