Skip to content

Commit 2dc3a69

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Remove ALLPHYSICAL memory registration mode
No HCA or RNIC in the kernel tree requires the use of ALLPHYSICAL. ALLPHYSICAL advertises in the clear on the network fabric an R_key that is good for all of the client's memory. No known exploit exists, but theoretically any user on the server can use that R_key on the client's QP to read or update any part of the client's memory. ALLPHYSICAL exposes the client to server bugs, including: o base/bounds errors causing data outside the i/o buffer to be accessed o RDMA access after reply causing data corruption and/or integrity fail ALLPHYSICAL can't protect application memory regions from server update after a local signal or soft timeout has terminated an RPC. ALLPHYSICAL chunks are no larger than a page. Special cases to handle small chunks and long chunk lists have been a source of implementation complexity and bugs. Signed-off-by: Chuck Lever <[email protected]> Tested-by: Steve Wise <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 42fe28f commit 2dc3a69

File tree

4 files changed

+2
-142
lines changed

4 files changed

+2
-142
lines changed

net/sunrpc/xprtrdma/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
obj-$(CONFIG_SUNRPC_XPRT_RDMA) += rpcrdma.o
22

33
rpcrdma-y := transport.o rpc_rdma.o verbs.o \
4-
fmr_ops.o frwr_ops.o physical_ops.o \
4+
fmr_ops.o frwr_ops.o \
55
svc_rdma.o svc_rdma_backchannel.o svc_rdma_transport.o \
66
svc_rdma_marshal.o svc_rdma_sendto.o svc_rdma_recvfrom.o \
77
module.o

net/sunrpc/xprtrdma/physical_ops.c

Lines changed: 0 additions & 122 deletions
This file was deleted.

net/sunrpc/xprtrdma/verbs.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
379379
struct rpcrdma_ia *ia = &xprt->rx_ia;
380380
int rc;
381381

382-
ia->ri_dma_mr = NULL;
383-
384382
ia->ri_id = rpcrdma_create_id(xprt, ia, addr);
385383
if (IS_ERR(ia->ri_id)) {
386384
rc = PTR_ERR(ia->ri_id);
@@ -418,9 +416,6 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
418416
case RPCRDMA_FRMR:
419417
ia->ri_ops = &rpcrdma_frwr_memreg_ops;
420418
break;
421-
case RPCRDMA_ALLPHYSICAL:
422-
ia->ri_ops = &rpcrdma_physical_memreg_ops;
423-
break;
424419
case RPCRDMA_MTHCAFMR:
425420
ia->ri_ops = &rpcrdma_fmr_memreg_ops;
426421
break;
@@ -585,8 +580,6 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
585580
out2:
586581
ib_free_cq(sendcq);
587582
out1:
588-
if (ia->ri_dma_mr)
589-
ib_dereg_mr(ia->ri_dma_mr);
590583
return rc;
591584
}
592585

@@ -600,8 +593,6 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
600593
void
601594
rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
602595
{
603-
int rc;
604-
605596
dprintk("RPC: %s: entering, connected is %d\n",
606597
__func__, ep->rep_connected);
607598

@@ -615,12 +606,6 @@ rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
615606

616607
ib_free_cq(ep->rep_attr.recv_cq);
617608
ib_free_cq(ep->rep_attr.send_cq);
618-
619-
if (ia->ri_dma_mr) {
620-
rc = ib_dereg_mr(ia->ri_dma_mr);
621-
dprintk("RPC: %s: ib_dereg_mr returned %i\n",
622-
__func__, rc);
623-
}
624609
}
625610

626611
/*

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ struct rpcrdma_ia {
6868
struct ib_device *ri_device;
6969
struct rdma_cm_id *ri_id;
7070
struct ib_pd *ri_pd;
71-
struct ib_mr *ri_dma_mr;
7271
struct completion ri_done;
7372
int ri_async_rc;
7473
unsigned int ri_max_frmr_depth;
@@ -269,8 +268,7 @@ struct rpcrdma_mw {
269268
* NOTES:
270269
* o RPCRDMA_MAX_SEGS is the max number of addressible chunk elements we
271270
* marshal. The number needed varies depending on the iov lists that
272-
* are passed to us, the memory registration mode we are in, and if
273-
* physical addressing is used, the layout.
271+
* are passed to us and the memory registration mode we are in.
274272
*/
275273

276274
struct rpcrdma_mr_seg { /* chunk descriptors */
@@ -417,7 +415,6 @@ struct rpcrdma_memreg_ops {
417415

418416
extern const struct rpcrdma_memreg_ops rpcrdma_fmr_memreg_ops;
419417
extern const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops;
420-
extern const struct rpcrdma_memreg_ops rpcrdma_physical_memreg_ops;
421418

422419
/*
423420
* RPCRDMA transport -- encapsulates the structures above for

0 commit comments

Comments
 (0)