aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsrael Rukshin <israelr@mellanox.com>2018-12-05 11:54:57 -0500
committerChristoph Hellwig <hch@lst.de>2018-12-07 10:11:11 -0500
commitd7dcdf9d4e15189ecfda24cc87339a3425448d5c (patch)
tree640703c9e73ab1e9148be0735e913f382531a45b
parent86880d646122240596d6719b642fee3213239994 (diff)
nvmet-rdma: fix response use after free
nvmet_rdma_release_rsp() may free the response before using it at error flow. Fixes: 8407879 ("nvmet-rdma: fix possible bogus dereference under heavy load") Signed-off-by: Israel Rukshin <israelr@mellanox.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/target/rdma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 3f7971d3706d..583086dd9cb9 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -529,6 +529,7 @@ static void nvmet_rdma_send_done(struct ib_cq *cq, struct ib_wc *wc)
529{ 529{
530 struct nvmet_rdma_rsp *rsp = 530 struct nvmet_rdma_rsp *rsp =
531 container_of(wc->wr_cqe, struct nvmet_rdma_rsp, send_cqe); 531 container_of(wc->wr_cqe, struct nvmet_rdma_rsp, send_cqe);
532 struct nvmet_rdma_queue *queue = cq->cq_context;
532 533
533 nvmet_rdma_release_rsp(rsp); 534 nvmet_rdma_release_rsp(rsp);
534 535
@@ -536,7 +537,7 @@ static void nvmet_rdma_send_done(struct ib_cq *cq, struct ib_wc *wc)
536 wc->status != IB_WC_WR_FLUSH_ERR)) { 537 wc->status != IB_WC_WR_FLUSH_ERR)) {
537 pr_err("SEND for CQE 0x%p failed with status %s (%d).\n", 538 pr_err("SEND for CQE 0x%p failed with status %s (%d).\n",
538 wc->wr_cqe, ib_wc_status_msg(wc->status), wc->status); 539 wc->wr_cqe, ib_wc_status_msg(wc->status), wc->status);
539 nvmet_rdma_error_comp(rsp->queue); 540 nvmet_rdma_error_comp(queue);
540 } 541 }
541} 542}
542 543