Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rxrpc: Fix insufficient receive notification generation

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>

+2 -4
+2 -4
net/rxrpc/input.c
··· 599 599 false, true, 600 600 rxrpc_propose_ack_input_data); 601 601 602 - if (seq0 == READ_ONCE(call->rx_hard_ack) + 1) { 603 - trace_rxrpc_notify_socket(call->debug_id, serial); 604 - rxrpc_notify_socket(call); 605 - } 602 + trace_rxrpc_notify_socket(call->debug_id, serial); 603 + rxrpc_notify_socket(call); 606 604 607 605 unlock: 608 606 spin_unlock(&call->input_lock);