rxrpc: Fix received abort handling
authorDavid Howells <dhowells@redhat.com>
Tue, 6 Feb 2018 16:44:12 +0000 (16:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Feb 2018 02:47:10 +0000 (21:47 -0500)
commit17e9e23b130e4e269fa53c2370325249f3ba75dd
tree328a562c4b4823a5479094f7925bb428b8c8eca2
parente729452ec33304260d4741e9ce67784a457ee1e6
rxrpc: Fix received abort handling

AF_RXRPC is incorrectly sending back to the server any abort it receives
for a client connection.  This is due to the final-ACK offload to the
connection event processor patch.  The abort code is copied into the
last-call information on the connection channel and then the event
processor is set.

Instead, the following should be done:

 (1) In the case of a final-ACK for a successful call, the ACK should be
     scheduled as before.

 (2) In the case of a locally generated ABORT, the ABORT details should be
     cached for sending in response to further packets related to that
     call and no further action scheduled at call disconnect time.

 (3) In the case of an ACK received from the peer, the call should be
     considered dead, no ABORT should be transmitted at this time.  In
     response to further non-ABORT packets from the peer relating to this
     call, an RX_USER_ABORT ABORT should be transmitted.

 (4) In the case of a call killed due to network error, an RX_USER_ABORT
     ABORT should be cached for transmission in response to further
     packets, but no ABORT should be sent at this time.

Fixes: 3136ef49a14c ("rxrpc: Delay terminal ACK transmission on a client call")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/conn_client.c
net/rxrpc/conn_object.c