From: hare@suse.de (Hannes Reinecke)
Subject: [PATCHv3 1/2] nvme-multipath: avoid crash on invalid subsystem cntlid enumeration
Date: Fri, 3 May 2019 15:37:35 +0200 [thread overview]
Message-ID: <20190503133736.111201-2-hare@suse.de> (raw)
In-Reply-To: <20190503133736.111201-1-hare@suse.de>
A process holding an open reference to a removed disk prevents it
from completing deletion, so its name continues to exist. A subsequent
gendisk creation may have the same cntlid which risks collision when
using that for the name. Use the unique ctrl->instance instead.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
drivers/nvme/host/multipath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 5c9429d41120..499acf07d61a 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -31,7 +31,7 @@ void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
} else if (ns->head->disk) {
sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
- ctrl->cntlid, ns->head->instance);
+ ctrl->instance, ns->head->instance);
*flags = GENHD_FL_HIDDEN;
} else {
sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
--
2.16.4
next prev parent reply other threads:[~2019-05-03 13:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 13:37 [PATCHv3 0/2] nvme: validate CNTLID Hannes Reinecke
2019-05-03 13:37 ` Hannes Reinecke [this message]
2019-05-03 16:01 ` [PATCHv3 1/2] nvme-multipath: avoid crash on invalid subsystem cntlid enumeration Keith Busch
2019-05-08 7:54 ` Christoph Hellwig
2019-05-03 13:37 ` [PATCHv3 2/2] nvme: validate cntlid during controller initialisation Hannes Reinecke
2019-05-03 16:16 ` Keith Busch
2019-05-03 19:12 ` Max Gurtovoy
2019-05-04 14:20 ` Minwoo Im
2019-05-08 7:54 ` Christoph Hellwig
2019-05-10 14:51 ` John Donnelly
2019-05-10 18:12 ` Chaitanya Kulkarni
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=20190503133736.111201-2-hare@suse.de \
--to=hare@suse.de \
/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