From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH] nvme-rdma: Fix early queue flags settings
Date: Tue, 20 Sep 2016 11:57:28 -0700 [thread overview]
Message-ID: <1474397848-19013-1-git-send-email-sagi@grimberg.me> (raw)
When we reconnect we can't really clear the
queue flags (DELETING flag in specific) because
we might end up trigerring a use-after-free condition
if we fail to establish the rdma connection.
Fixes: e89ca58f9c90 ("nvme-rdma: add DELETING queue flag")
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
drivers/nvme/host/rdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index c2c2c28e6eb5..3437f0e8866f 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -561,7 +561,6 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl,
queue = &ctrl->queues[idx];
queue->ctrl = ctrl;
- queue->flags = 0;
init_completion(&queue->cm_done);
if (idx > 0)
@@ -595,6 +594,7 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl,
goto out_destroy_cm_id;
}
+ queue->flags = 0;
set_bit(NVME_RDMA_Q_CONNECTED, &queue->flags);
return 0;
--
1.9.1
next reply other threads:[~2016-09-20 18:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 18:57 Sagi Grimberg [this message]
2016-09-20 19:01 ` [PATCH] nvme-rdma: Fix early queue flags settings Steve Wise
2016-09-20 19:05 ` Sagi Grimberg
2016-09-20 20:08 ` Christoph Hellwig
2016-09-20 20:14 ` Steve Wise
2016-09-21 3:38 ` Sagi Grimberg
2016-09-21 14:01 ` 'Christoph Hellwig'
2016-09-21 14:18 ` Steve Wise
2016-09-21 14:52 ` Steve Wise
2016-09-21 15:10 ` Steve Wise
2016-09-21 14:36 ` Sagi Grimberg
2016-09-21 15:50 ` Steve Wise
2016-09-21 19:57 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474397848-19013-1-git-send-email-sagi@grimberg.me \
--to=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).