mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Max Gurtovoy <maxg@mellanox.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	<linux-kernel@vger.kernel.org>, <linux-nvme@lists.infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	"Sagi Grimberg" <sagi@grimberg.me>
Cc: Stephen Bates <sbates@raithlin.com>
Subject: Re: [PATCH v2 1/2] nvmet: Fix use-after-free bug when a port is removed
Date: Fri, 5 Jul 2019 15:17:56 +0300	[thread overview]
Message-ID: <731bd412-2e44-c027-726e-d73a42c5f773@mellanox.com> (raw)
In-Reply-To: <d79a4c2d-9326-2805-b2a2-ca265ab2a717@deltatee.com>


On 7/5/2019 12:01 AM, Logan Gunthorpe wrote:
>
> On 2019-07-04 3:00 p.m., Max Gurtovoy wrote:
>> Hi Logan,
>>
>> On 7/4/2019 2:03 AM, Logan Gunthorpe wrote:
>>> When a port is removed through configfs, any connected controllers
>>> are still active and can still send commands. This causes a
>>> use-after-free bug which is detected by KASAN for any admin command
>>> that dereferences req->port (like in nvmet_execute_identify_ctrl).
>>>
>>> To fix this, disconnect all active controllers when a subsystem is
>>> removed from a port. This ensures there are no active controllers
>>> when the port is eventually removed.
>> so now we are enforcing controller existence with port configfs, right ?
>> sounds reasonable.
> Correct.
>
>> Did you run your patches with other transport (RDMA/TCP/FC) ?
> Just RDMA and loop. I suppose I could test with TCP but I don't have FC
> hardware.

Great.

the code looks good:

Reviewed-by: Max Gurtovoy <maxg@mellanox.com>

>
> Logan

  reply	other threads:[~2019-07-05 12:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 23:03 [PATCH v2 0/2] Fix use-after-free bug when ports are removed Logan Gunthorpe
2019-07-03 23:03 ` [PATCH v2 1/2] nvmet: Fix use-after-free bug when a port is removed Logan Gunthorpe
2019-07-03 23:49   ` Sagi Grimberg
2019-07-04 21:00   ` Max Gurtovoy
2019-07-04 21:01     ` Logan Gunthorpe
2019-07-05 12:17       ` Max Gurtovoy [this message]
2019-07-03 23:03 ` [PATCH v2 2/2] nvmet-loop: Flush nvme_delete_wq when removing the port Logan Gunthorpe
2019-07-03 23:49   ` Sagi Grimberg
2019-07-05 12:20   ` Max Gurtovoy

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=731bd412-2e44-c027-726e-d73a42c5f773@mellanox.com \
    --to=maxg@mellanox.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=logang@deltatee.com \
    --cc=sagi@grimberg.me \
    --cc=sbates@raithlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®