BUG/MEDIUM: quic: do not keep 0-RTT packets which cannot be decrypted
On a listener with "allow-0rtt", a 0-RTT packet whose header protection
cannot be removed is queued in the 0-RTT encryption level pqpkts list and
its content is copied into the connection Rx buffer. That buffer is
reclaimed in order by quic_rx_pkts_del(), which stops at the first
referenced packet, so a queued 0-RTT packet pins all the data behind it.
Commit
bba6baff3 ("BUG/MEDIUM: quic: prevent conn freeze on 0RTT
undeciphered content") addressed this by releasing these packets at
handshake completion, unconditionally. Commit
b1af5dabf ("BUG/MEDIUM:
quic: avoid freezing 0RTT connections") then restricted that release to
the case where an address validation token was received: without a token,
the peer address is only validated by the handshake completion itself, so
the 0-RTT data are to be processed once the handshake is done.
That reasoning holds only if 0-RTT keys exist. When none were installed,
because the early data were rejected by the TLS stack or because the TLS
library does not support 0-RTT, the packets can never be decrypted, so
nothing releases them before the connection is freed. A 0-RTT packet
received after handshake completion is queued the same way, with even
less chance of ever being decrypted.
The Rx buffer then fills up and every packet of the connection is dropped
until the idle timeout, accounted as dropped_pkt_bufoverrun and shown as
dropbuff= in "show quic full". Since the buffer is reclaimed in order,
the whole connection stalls, not only the 0-RTT traffic.
Release the pending 0-RTT packets at handshake completion when there is
no 0-RTT RX secret, and drop 0-RTT packets received after handshake
completion without 0-RTT keys instead of queueing them.
This is a regression from
b1af5dabf, so it must be backported to 2.9 and
above only.