Skip to content

Commit

Permalink
rxrpc: Fix insufficient receive notification generation
Browse files Browse the repository at this point in the history
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: 248f219 ("rxrpc: Rewrite the data and ack handling code")
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
dhowells committed Jan 30, 2020
1 parent fac20b9 commit f71dbf2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/rxrpc/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,8 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb)
false, true,
rxrpc_propose_ack_input_data);

if (seq0 == 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);
Expand Down

0 comments on commit f71dbf2

Please sign in to comment.