linux/net/sunrpc/xprtrdma
Chuck Lever 451d26e151 xprtrdma: Pass only the list of registered MRs to ro_unmap_sync
There are rare cases where an rpcrdma_req can be re-used (via
rpcrdma_buffer_put) while the RPC reply handler is still running.
This is due to a signal firing at just the wrong instant.

Since commit 9d6b040978 ("xprtrdma: Place registered MWs on a
per-req list"), rpcrdma_mws are self-contained; ie., they fully
describe an MR and scatterlist, and no part of that information is
stored in struct rpcrdma_req.

As part of closing the above race window, pass only the req's list
of registered MRs to ro_unmap_sync, rather than the rpcrdma_req
itself.

Some extra transport header sanity checking is removed. Since the
client depends on its own recollection of what memory had been
registered, there doesn't seem to be a way to abuse this change.

And, the check was not terribly effective. If the client had sent
Read chunks, the "list_empty" test is negative in both of the
removed cases, which are actually looking for Write or Reply
chunks.

BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=305
Fixes: 68791649a7 ('xprtrdma: Invalidate in the RPC reply ... ')
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2017-07-13 16:00:10 -04:00
..
backchannel.c xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup() 2017-05-24 07:53:37 -04:00
fmr_ops.c xprtrdma: Pass only the list of registered MRs to ro_unmap_sync 2017-07-13 16:00:10 -04:00
frwr_ops.c xprtrdma: Pass only the list of registered MRs to ro_unmap_sync 2017-07-13 16:00:10 -04:00
Makefile svcrdma: Introduce local rdma_rw API helpers 2017-04-25 17:25:55 -04:00
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
rpc_rdma.c xprtrdma: Pass only the list of registered MRs to ro_unmap_sync 2017-07-13 16:00:10 -04:00
svc_rdma_backchannel.c svcrdma: Clean up RPC-over-RDMA backchannel reply processing 2017-04-25 17:25:55 -04:00
svc_rdma_marshal.c svcrdma: Clean out old XDR encoders 2017-04-25 17:25:56 -04:00
svc_rdma_recvfrom.c svcrdma: Clean up RPC-over-RDMA backchannel reply processing 2017-04-25 17:25:55 -04:00
svc_rdma_rw.c svcrdma: Introduce local rdma_rw API helpers 2017-04-25 17:25:55 -04:00
svc_rdma_sendto.c svcrdma: Remove the req_map cache 2017-04-25 17:25:55 -04:00
svc_rdma_transport.c svcrdma: Remove the req_map cache 2017-04-25 17:25:55 -04:00
svc_rdma.c svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt 2017-04-25 17:25:55 -04:00
transport.c xprtrdma: Support unplugging an HCA from under an NFS mount 2017-04-25 16:12:24 -04:00
verbs.c xprtrdma: Pre-mark remotely invalidated MRs 2017-07-13 16:00:10 -04:00
xprt_rdma.h xprtrdma: Pass only the list of registered MRs to ro_unmap_sync 2017-07-13 16:00:10 -04:00