linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme-rdma: Always signal fabrics private commands
@ 2016-06-23 16:08 Sagi Grimberg
  2016-06-23 18:17 ` Steve Wise
  2016-06-24  7:07 ` Christoph Hellwig
  0 siblings, 2 replies; 18+ messages in thread
From: Sagi Grimberg @ 2016-06-23 16:08 UTC (permalink / raw)


Some RDMA adapters were observed to have some issues
with selective completion signaling which might cause
a use-after-free condition when the device accidentally
reports a completion when the caller context (wr_cqe)
was already freed.

The first time this was detected was for flush requests
that were not allocated from the tagset, now we see that
in the error path of fabrics connect (admin). The normal
I/O selective signaling is safe because we free the tagset
only when all the queue-pairs were drained.

Reported-by: Steve Wise <swise at opengridcomputing.com>
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/rdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index b939f89ad936..bf141cb4e671 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1453,7 +1453,8 @@ static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
 	ib_dma_sync_single_for_device(dev, sqe->dma,
 			sizeof(struct nvme_command), DMA_TO_DEVICE);
 
-	if (rq->cmd_type == REQ_TYPE_FS && req_op(rq) == REQ_OP_FLUSH)
+	if ((rq->cmd_type == REQ_TYPE_FS && req_op(rq) == REQ_OP_FLUSH) ||
+	    rq->cmd_type == REQ_TYPE_DRV_PRIV)
 		flush = true;
 	ret = nvme_rdma_post_send(queue, sqe, req->sge, req->num_sge,
 			req->need_inval ? &req->reg_wr.wr : NULL, flush);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-07-13 15:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-23 16:08 [PATCH] nvme-rdma: Always signal fabrics private commands Sagi Grimberg
2016-06-23 18:17 ` Steve Wise
2016-06-24  7:07 ` Christoph Hellwig
2016-06-24 14:05   ` Steve Wise
2016-06-26 16:41   ` Sagi Grimberg
2016-06-28  8:41     ` Christoph Hellwig
2016-06-28 14:20       ` Steve Wise
2016-06-29 14:57         ` Steve Wise
2016-06-30  6:36           ` 'Christoph Hellwig'
2016-06-30 13:44             ` Steve Wise
2016-06-30 15:10               ` Steve Wise
2016-07-13 10:08               ` Sagi Grimberg
2016-07-13 10:11                 ` Sagi Grimberg
2016-07-13 14:28                   ` Steve Wise
2016-07-13 14:47                     ` Sagi Grimberg
2016-07-13 14:51                       ` Steve Wise
2016-07-13 15:02                         ` Sagi Grimberg
2016-07-13 15:12                           ` Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).