rxrpc, afs: Fix selection of abort codes
authorDavid Howells <dhowells@redhat.com>
Sat, 21 May 2022 07:45:48 +0000 (08:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 May 2022 20:03:02 +0000 (21:03 +0100)
commitde696c4784f0706884458893c5a6c39b3a3ff65c
tree0432876e30fb4162733ade0543cd2c11bb8c73ef
parent4ba68c5192554876bd8c3afd904e3064d2915341
rxrpc, afs: Fix selection of abort codes

The RX_USER_ABORT code should really only be used to indicate that the user
of the rxrpc service (ie. userspace) implicitly caused a call to be aborted
- for instance if the AF_RXRPC socket is closed whilst the call was in
progress.  (The user may also explicitly abort a call and specify the abort
code to use).

Change some of the points of generation to use other abort codes instead:

 (1) Abort the call with RXGEN_SS_UNMARSHAL or RXGEN_CC_UNMARSHAL if we see
     ENOMEM and EFAULT during received data delivery and abort with
     RX_CALL_DEAD in the default case.

 (2) Abort with RXGEN_SS_MARSHAL if we get ENOMEM whilst trying to send a
     reply.

 (3) Abort with RX_CALL_DEAD if we stop hearing from the peer if we had
     heard from the peer and abort with RX_CALL_TIMEOUT if we hadn't.

 (4) Abort with RX_CALL_DEAD if we try to disconnect a call that's not
     completed successfully or been aborted.

Reported-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/afs/rxrpc.c
net/rxrpc/call_event.c
net/rxrpc/conn_object.c