two small nvmf fixes for 4.8
Subsystems (2)
Christoph Hellwig
maintainerOne is a potential use after free that will actually be easy to trigger with the new default hostnqn support in nvme-cli, and the other fixes up the dependencies in the Kconfig file so that we don't always drag in the traditional NVMe PCIe driver.
Christoph Hellwig
maintainerPATCH 1/2 nvme-fabrics: get a reference when reusing a nvme_host structure
Without this we'll get a use after free after connecting two controller using the same hostnqn and then disconnecting one of them.
--- drivers/nvme/host/fabrics.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/host/fabrics.c +3 -1
@@ -47,8 +47,10 @@ static struct nvmf_host *nvmf_host_add(const char *hostnqn)mutex_lock (&nvmf_hosts_mutex); host =__nvmf_host_find (hostnqn); -if (host) +if (host) { +kref_get (&host->ref); goto out_unlock; + } host =kmalloc (sizeof (*host),GFP_KERNEL );if (!host)
Signature · 1 line
2.1.4
Christoph Hellwig
maintainerPATCH 2/2 nvme: fabrics drivers don't need the nvme-pci driver
In reply to Christoph HellwigSo select the NVME_CORE symbol instead of depending on BLK_DEV_NVME.
--- drivers/nvme/host/Kconfig | 2 +- drivers/nvme/target/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/Kconfig +1 -1
@@ -31,7 +31,7 @@ config NVME_FABRICS config NVME_RDMA tristate "NVM Express over Fabrics RDMA host driver" depends on INFINIBAND - depends on BLK_DEV_NVME + select NVME_CORE select NVME_FABRICS select SG_POOL help
drivers/nvme/target/Kconfig +1 -1
@@ -15,8 +15,8 @@ config NVME_TARGET config NVME_TARGET_LOOP tristate "NVMe loopback device support" - depends on BLK_DEV_NVME depends on NVME_TARGET + select NVME_CORE select NVME_FABRICS select SG_POOL help
Signature · 1 line
2.1.4
J Freyensee
Reviewed-by Jay FreyenseeQuoted 7 lines · Christoph Hellwig
One is a potential use after free that will actually be easy to trigger
with the new default hostnqn support in nvme-cli, and the other fixes up the dependencies in theKconfigfile so that we don't always drag in
the traditional NVMe PCIe driver.
Series looks good to me,
Quoted 5 lines
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 5 lines
One is a potential use after free that will actually be easy to trigger with the new default hostnqn support in nvme-cli, and the other fixes up the dependencies in the
Kconfigfile so that we don't always drag in the traditional NVMe PCIe driver.
Queued to nvmf-4.8-rc, thanks Christoph...