summaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-06-17 23:01:23 +0100
committerSasha Levin <sashal@kernel.org>2020-06-30 23:17:11 -0400
commit62745e57440e3dc3b60f2d67a0aa0ff83b7a2bcb (patch)
treea3e8a09c9c2b18181105a7311c99b901a9514b27 /net/rxrpc
parent0f29174030fa7beb532cf253c61cf961a59d5970 (diff)
downloadlinux-stable-62745e57440e3dc3b60f2d67a0aa0ff83b7a2bcb.tar.gz
linux-stable-62745e57440e3dc3b60f2d67a0aa0ff83b7a2bcb.tar.bz2
linux-stable-62745e57440e3dc3b60f2d67a0aa0ff83b7a2bcb.zip
rxrpc: Fix handling of rwind from an ACK packet
[ Upstream commit a2ad7c21ad8cf1ce4ad65e13df1c2a1c29b38ac5 ] The handling of the receive window size (rwind) from a received ACK packet is not correct. The rxrpc_input_ackinfo() function currently checks the current Tx window size against the rwind from the ACK to see if it has changed, but then limits the rwind size before storing it in the tx_winsize member and, if it increased, wake up the transmitting process. This means that if rwind > RXRPC_RXTX_BUFF_SIZE - 1, this path will always be followed. Fix this by limiting rwind before we compare it to tx_winsize. The effect of this can be seen by enabling the rxrpc_rx_rwind_change tracepoint. Fixes: 702f2ac87a9a ("rxrpc: Wake up the transmitter if Rx window size increases on the peer") Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/input.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index e65b230fce4c..58bd558a277a 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -735,13 +735,12 @@ static void rxrpc_input_ackinfo(struct rxrpc_call *call, struct sk_buff *skb,
ntohl(ackinfo->rxMTU), ntohl(ackinfo->maxMTU),
rwind, ntohl(ackinfo->jumbo_max));
+ if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
+ rwind = RXRPC_RXTX_BUFF_SIZE - 1;
if (call->tx_winsize != rwind) {
- if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
- rwind = RXRPC_RXTX_BUFF_SIZE - 1;
if (rwind > call->tx_winsize)
wake = true;
- trace_rxrpc_rx_rwind_change(call, sp->hdr.serial,
- ntohl(ackinfo->rwind), wake);
+ trace_rxrpc_rx_rwind_change(call, sp->hdr.serial, rwind, wake);
call->tx_winsize = rwind;
}