aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-10-02 15:49:33 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-10-02 15:49:33 -0400
commit8dbb09570d16929fefd492410d60a918bc18ad5b (patch)
treef95439d65d53bfb2dcd1adb37ac1d9ff3c1de7c3
parent5e99b532bb95f8e6bf39f4500f0caef070bac16d (diff)
parent72c021738252dde5849d575a650239d6404930ee (diff)
Merge tag 'nfs-rdma-for-4.3-2' of git://git.linux-nfs.org/projects/anna/nfs-rdma
NFS: NFSoRDMA bugfix Fixes a use-after-free bug. Signed-off-by: Anna Schumaker <Anna.Schumaker@netapp.com>
-rw-r--r--net/sunrpc/xprtrdma/transport.c2
-rw-r--r--net/sunrpc/xprtrdma/verbs.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 64443eb754ad..41e452bc580c 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -270,8 +270,8 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)
270 270
271 xprt_clear_connected(xprt); 271 xprt_clear_connected(xprt);
272 272
273 rpcrdma_buffer_destroy(&r_xprt->rx_buf);
274 rpcrdma_ep_destroy(&r_xprt->rx_ep, &r_xprt->rx_ia); 273 rpcrdma_ep_destroy(&r_xprt->rx_ep, &r_xprt->rx_ia);
274 rpcrdma_buffer_destroy(&r_xprt->rx_buf);
275 rpcrdma_ia_close(&r_xprt->rx_ia); 275 rpcrdma_ia_close(&r_xprt->rx_ia);
276 276
277 xprt_rdma_free_addresses(xprt); 277 xprt_rdma_free_addresses(xprt);
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index eb081ad05e33..8a477e27bad7 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -755,19 +755,22 @@ rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
755 755
756 cancel_delayed_work_sync(&ep->rep_connect_worker); 756 cancel_delayed_work_sync(&ep->rep_connect_worker);
757 757
758 if (ia->ri_id->qp) { 758 if (ia->ri_id->qp)
759 rpcrdma_ep_disconnect(ep, ia); 759 rpcrdma_ep_disconnect(ep, ia);
760
761 rpcrdma_clean_cq(ep->rep_attr.recv_cq);
762 rpcrdma_clean_cq(ep->rep_attr.send_cq);
763
764 if (ia->ri_id->qp) {
760 rdma_destroy_qp(ia->ri_id); 765 rdma_destroy_qp(ia->ri_id);
761 ia->ri_id->qp = NULL; 766 ia->ri_id->qp = NULL;
762 } 767 }
763 768
764 rpcrdma_clean_cq(ep->rep_attr.recv_cq);
765 rc = ib_destroy_cq(ep->rep_attr.recv_cq); 769 rc = ib_destroy_cq(ep->rep_attr.recv_cq);
766 if (rc) 770 if (rc)
767 dprintk("RPC: %s: ib_destroy_cq returned %i\n", 771 dprintk("RPC: %s: ib_destroy_cq returned %i\n",
768 __func__, rc); 772 __func__, rc);
769 773
770 rpcrdma_clean_cq(ep->rep_attr.send_cq);
771 rc = ib_destroy_cq(ep->rep_attr.send_cq); 774 rc = ib_destroy_cq(ep->rep_attr.send_cq);
772 if (rc) 775 if (rc)
773 dprintk("RPC: %s: ib_destroy_cq returned %i\n", 776 dprintk("RPC: %s: ib_destroy_cq returned %i\n",