mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] rxrpc: Fix missing lower bound in rxrpc_resend_tlp()
@ 2026-11-22 13:55 Lin Ma
  2026-11-22 14:03 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Lin Ma @ 2026-11-22 13:55 UTC (permalink / raw)
  To: David Howells, Marc Dionne; +Cc: netdev, linux-afs, linux-kernel, Lin Ma

The fast path in rxrpc_resend_tlp() checks that tx_transmitted is before
the end of the tail Tx queue segment, but doesn't check that it is at or
after the segment's base.  If it is below the base, the wrong slot can be
selected and rxrpc_retransmit_data() may dereference a NULL txbuf.

This can happen when rxrpc_send_data_packet() fails to allocate its wire
header after rxrpc_transmit_fresh_data() has advanced tx_qtail and tx_top
but before tx_transmitted is updated.  A subsequent TLP probe can then
enter rxrpc_resend_tlp() in that state.

Add the missing lower-bound check, matching the slower queue walk.  The
reporter triggered this at runtime.

Fixes: 7c482665931b6 ("rxrpc: Implement RACK/TLP to deal with transmission stalls [RFC8985]")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
---
 net/rxrpc/call_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index fec59d9338b9..4fca790a007f 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -141,6 +141,7 @@ void rxrpc_resend_tlp(struct rxrpc_call *call)
 	/* There's a chance it'll be on the tail segment of the queue. */
 	req.tq = READ_ONCE(call->tx_qtail);
 	if (req.tq &&
+	    after_eq(call->tx_transmitted, req.tq->qbase) &&
 	    before(call->tx_transmitted, req.tq->qbase + RXRPC_NR_TXQUEUE)) {
 		rxrpc_retransmit_data(call, &req);
 		return;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-22 13:55 [PATCH net] rxrpc: Fix missing lower bound in rxrpc_resend_tlp() Lin Ma
2026-11-22 14:03 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®