All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Israel Rukshin <israelr@mellanox.com>,
	Linux-nvme <linux-nvme@lists.infradead.org>,
	Christoph Hellwig <hch@lst.de>
Cc: Max Gurtovoy <maxg@mellanox.com>
Subject: Re: [PATCH 4/4] nvme: Fix controller use after free at create_ctrl callback
Date: Mon, 16 Mar 2020 09:47:14 -0700	[thread overview]
Message-ID: <7710cc5f-850a-f260-fb02-423a46867534@grimberg.me> (raw)
In-Reply-To: <e12ed56f-6bfe-dcee-9967-f6f58f06a9f0@mellanox.com>


>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index c0d9b19..7976955 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -3224,6 +3224,10 @@ static ssize_t nvme_sysfs_delete(struct device 
>>> *dev,
>>>   {
>>>       struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
>>>   +    /* Can't delete non-created controllers */
>>> +    if (!ctrl->created)
>>> +        return -EBUSY;
>>> +
>>
>> Not ideal that core checks attribute that fabrics is setting. Maybe
>> move this to nvme_start_ctrl?
> 
> I can't move this to nvme_start_ctrl(), because rdma/tcp have not taken 
> ctrl refcount yet.

Can you explain what is the issue with the ref counting for setting this
flag?

> Beside that, nvme_sysfs_delete function is only used by fabrics modules.
> 
> PCI module doesn't set delete_ctrl ops.

That can change though.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-03-16 16:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 15:00 [PATCH 0/4] nvme: Fixes for deleting a ctrl before it was created Israel Rukshin
2020-03-11 15:00 ` [PATCH 1/4] nvme-rdma: Fix warning at nvme_rdma_setup_ctrl Israel Rukshin
2020-03-12  6:37   ` Sagi Grimberg
2020-03-12  9:03     ` Israel Rukshin
2020-03-12 23:08       ` Sagi Grimberg
2020-03-15  8:56         ` Israel Rukshin
2020-03-16 16:43           ` Sagi Grimberg
2020-03-16 18:43             ` Max Gurtovoy
2020-03-17 12:52   ` Christoph Hellwig
2020-03-11 15:00 ` [PATCH 2/4] nvme-tcp: Fix warning at nvme_tcp_setup_ctrl Israel Rukshin
2020-03-11 15:00 ` [PATCH 3/4] nvme: Remove unused return code from nvme_delete_ctrl_sync Israel Rukshin
2020-03-12  6:37   ` Sagi Grimberg
2020-03-17 12:53   ` Christoph Hellwig
2020-03-11 15:00 ` [PATCH 4/4] nvme: Fix controller use after free at create_ctrl callback Israel Rukshin
2020-03-12  6:45   ` Sagi Grimberg
2020-03-12 12:53     ` Israel Rukshin
2020-03-16 16:47       ` Sagi Grimberg [this message]
2020-03-17 11:49         ` Israel Rukshin
2020-03-17 12:56           ` Christoph Hellwig
2020-03-17 13:13             ` Israel Rukshin

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=7710cc5f-850a-f260-fb02-423a46867534@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=hch@lst.de \
    --cc=israelr@mellanox.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=maxg@mellanox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.