Re: [PATCH net v3 08/10] rxrpc: Fix detection of TLP probe response

From: netdev-bot+sashiko

Date: Fri Nov 27 2026 - 05:14:18 EST


Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The probe-completion test in rxrpc_input_ack(), `if
(after_eq(summary.acked_serial, call->tlp_serial)) call->tlp_serial =…
- [Low] The first paragraph of the commit message says the patch fixes a
bug: without a ->tlp_serial check, an ACK of a packet matching a stale…

--

rxrpc: Fix detection of TLP probe response

This commit adds a ->tlp_serial check before setting
summary->tlp_probe_acked in rxrpc_rotate_tx_window(), and moves the
->tlp_serial check out of rxrpc_tlp_process_ack() into its caller. It also
makes rxrpc_input_ack() check for a TLP probe response on ACKs that
rxrpc_is_ack_valid() discards as out of order or duplicate.

> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
> index 63a0feae2081d..d01a8d95dc6db 100644
> --- a/net/rxrpc/input.c
> +++ b/net/rxrpc/input.c
> @@ -275,7 +275,8 @@ static bool rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to,
> /* Packet directly hard ACK'd. */
> tq->nr_reported_acks++;
> rxrpc_input_rack_one(call, summary, tq, ix);
> - if (seq == call->tlp_seq)
> + if (call->tlp_serial &&
> + seq == call->tlp_seq)
> summary->tlp_probe_acked = true;

[Severity: Low]

The commit message says:

Fix detection of the TLP probe response to include a check that
->tlp_serial is valid, otherwise it's possible to see an ACK of a packet
that matches an old value of ->tlp_seq as a probe response.

Does this part of the patch change behaviour at this commit?

Only rxrpc_tlp_process_ack() reads summary->tlp_probe_acked. Before this
patch, that function already returned early when no probe was
outstanding:

if (!call->tlp_serial || after(call->tlp_seq, call->acks_hard_ack))
return;

Within one rxrpc_input_ack() call, call->tlp_serial can't go from zero to
non-zero between the rotation and rxrpc_tlp_process_ack(). Only
rxrpc_tlp_send_probe() and rxrpc_prepare_data_packet() set it, and both
run from the rack timer path. The summary is local to each ACK, and no
tracepoint records tlp_probe_acked.

So a stale tlp_probe_acked was already being ignored. The new guards here
and in the soft NAK branch look like they only move the existing check
into the callers.

The guard starts to matter with the later commit "rxrpc: Fix counting of
in-flight transmitted packets", which adds rxrpc_tlp_end_probe() to this
block. Could the commit message describe this part as preparation for that
change? Otherwise stable backporters may think they are getting two fixes.

[ ... ]

> @@ -1139,7 +1141,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
> /* Discard any out-of-order or duplicate ACKs (outside lock). */
> if (!rxrpc_is_ack_valid(call, hard_ack, prev_pkt)) {
> trace_rxrpc_rx_discard_ack(call, summary.ack_serial, hard_ack, prev_pkt);
> - goto send_response; /* Still respond if requested. */
> + goto check_for_tlp_probe; /* Still respond if requested. */
> }
>
> trailer.maxMTU = 0;
> @@ -1217,9 +1219,16 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
> */
> rxrpc_congestion_management(call, &summary);
> rxrpc_rack_detect_loss_and_arm_timer(call, &summary);
> - rxrpc_tlp_process_ack(call, &summary);
> - if (call->tlp_serial && after_eq(summary.acked_serial, call->tlp_serial))
> - call->tlp_serial = 0;
> +
> +check_for_tlp_probe:
> + if (call->tlp_serial) {
> + /* Need to check to see if the ACK is a TLP probe response,
> + * even if the ACKs may have come out of order.
> + */
> + rxrpc_tlp_process_ack(call, &summary);
> + if (after_eq(summary.acked_serial, call->tlp_serial))
> + call->tlp_serial = 0;
^^^^

[Severity: Medium]

Can this end an outstanding TLP probe because of an ACK that doesn't
respond to any packet?

An acked_serial of 0 means the ACK wasn't sent in reply to a particular
packet. Elsewhere, rxrpc_input_ack() checks if (summary.acked_serial)
before it uses the value, but after_eq() here treats 0 as a normal serial.

rxrpc_get_next_serial() hands out connection serials starting at 1 and
skips only 0:

serial = conn->tx_serial;
if (serial == 0)
serial = 1;
conn->tx_serial = serial + 1;

After a long-lived connection has used more than 2^31 serials, tlp_serial
will be above 0x80000000. At that point after_eq(0, tlp_serial) is true,
and any ACK with acked_serial == 0 clears tlp_serial.

Linux peers send these ACKs routinely. For example,
rxrpc_input_call_event() does:

rxrpc_send_ACK(call, RXRPC_ACK_DELAY, 0,
rxrpc_propose_ack_delayed_ack);

and it sends IDLE and PING ACKs with serial 0 as well.

The in-order ACK path had this problem before this patch. The new goto
check_for_tlp_probe on the rxrpc_is_ack_valid() failure path means that
discarded out-of-order and duplicate ACKs, including serial-0 ones, now
reach the same comparison.

If tlp_serial is cleared early, a later ACK that really covers tlp_seq
fails the call->tlp_serial tests in rxrpc_rotate_tx_window(). It also
skips rxrpc_tlp_process_ack(), so the RFC 8985 section 7.4 handling never
runs. rxrpc_tlp_send_probe() only checks !call->tlp_serial, so it can send
another probe on the next PTO.

The problem is still there at the end of the series. After the later
commit "rxrpc: Fix counting of in-flight transmitted packets", this line
calls rxrpc_tlp_end_probe(). That also clears tlp_in_flight and
decrements tx_in_flight while the probe packet is still unacknowledged.

Would requiring a non-zero acked_serial here help, something like:

if (summary.acked_serial &&
after_eq(summary.acked_serial, call->tlp_serial))

> + }
>
> send_response:
> if (summary.ack_reason == RXRPC_ACK_PING)

[ ... ]

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124161302.4044422-1-dhowells%40redhat.com