]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rxrpc: Fix insufficient receive notification generation
authorDavid Howells <dhowells@redhat.com>
Thu, 30 Jan 2020 21:50:36 +0000 (21:50 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:33:54 +0000 (04:33 -0800)
[ Upstream commit f71dbf2fb28489a79bde0dca1c8adfb9cdb20a6b ]

In rxrpc_input_data(), rxrpc_notify_socket() is called if the base sequence
number of the packet is immediately following the hard-ack point at the end
of the function.  However, this isn't sufficient, since the recvmsg side
may have been advancing the window and then overrun the position in which
we're adding - at which point rx_hard_ack >= seq0 and no notification is
generated.

Fix this by always generating a notification at the end of the input
function.

Without this, a long call may stall, possibly indefinitely.

Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rxrpc/input.c

index 2f91ab909191b0b46243780cd00469216e269d06..d9beb28fc32f2eacf5bcfa8f2d5392ef450e1087 100644 (file)
@@ -612,10 +612,8 @@ ack:
                                  false, true,
                                  rxrpc_propose_ack_input_data);
 
-       if (sp->hdr.seq == READ_ONCE(call->rx_hard_ack) + 1) {
-               trace_rxrpc_notify_socket(call->debug_id, serial);
-               rxrpc_notify_socket(call);
-       }
+       trace_rxrpc_notify_socket(call->debug_id, serial);
+       rxrpc_notify_socket(call);
 
 unlock:
        spin_unlock(&call->input_lock);