]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
rxrpc: Fix handling of rwind from an ACK packet
authorDavid Howells <dhowells@redhat.com>
Wed, 17 Jun 2020 22:01:23 +0000 (23:01 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit1a8c217e66631ba9cd05b2c62bea9aaa4c081ebe
tree46e68d9f4c5affe6bf084536b65a39f43e72a500
parent0daf1e94a4abedc68e8227ecf83e2b90e7605b83
rxrpc: Fix handling of rwind from an ACK packet

BugLink: https://bugs.launchpad.net/bugs/1885942
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/rxrpc/input.c