With RACK-TLP, under some circumstances a packet that is presumed lost has its xmit timestamp reset when it is marked lost. However, if an ACK then turns up anyway, rxrpc_rack_update() sees a bad RTT calculation because the xmit_ts is calculated as being KTIME_MAX. Fix this by skipping the RTT processing in such a case. Fixes: 7c482665931b ("rxrpc: Implement RACK/TLP to deal with transmission stalls [RFC8985]") Signed-off-by: David Howells cc: Marc Dionne cc: Jeffrey Altman cc: Eric Dumazet cc: "David S. Miller" cc: Jakub Kicinski cc: Paolo Abeni cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@vger.kernel.org --- net/rxrpc/input_rack.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/rxrpc/input_rack.c b/net/rxrpc/input_rack.c index c4276534f539..e5288e5beb59 100644 --- a/net/rxrpc/input_rack.c +++ b/net/rxrpc/input_rack.c @@ -71,6 +71,12 @@ static void rxrpc_rack_update(struct rxrpc_call *call, if (__test_and_clear_bit(ix, &tq->segment_lost)) call->tx_nr_lost--; + /* A packet may get marked lost and then ACK'd before we get to + * retransmitting which can result in xmit_ts having been reset. + */ + if (tq->segment_xmit_ts[ix] == UINT_MAX) + return; + if (test_bit(ix, &tq->segment_retransmitted)) { /* Use Rx.serial instead of TCP.ACK.ts_option.echo_reply. */ if (before(call->acks_highest_serial, tq->segment_serial[ix]))