public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>
Subject: Re: [PATCH v2] nvmet: Avoid potential UAF in nvmet_req_complete()
Date: Mon, 6 Mar 2023 05:04:19 +0000	[thread overview]
Message-ID: <4456fa26-affa-aa28-9837-e14375a8c4fa@nvidia.com> (raw)
In-Reply-To: <20230306011313.99870-1-damien.lemoal@opensource.wdc.com>

On 3/5/2023 5:13 PM, Damien Le Moal wrote:
> An nvme target ->queue_response() operation implementation may free the
> request passed as argument. Such implementation potentially could result
> in a use after free of the request pointer when percpu_ref_put() is
> called in nvmet_req_complete().
> 
> Avoid such problem by using a local variable to save the sq pointer
> before calling __nvmet_req_complete(), thus avoiding dereferencing the
> req pointer after that function call.
> 
> Fixes: a07b4970f464 ("nvmet: add a generic NVMe target")
> Cc: stable@vger.kernel.org
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> ---
> 

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck


  reply	other threads:[~2023-03-06  5:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  1:13 [PATCH v2] nvmet: Avoid potential UAF in nvmet_req_complete() Damien Le Moal
2023-03-06  5:04 ` Chaitanya Kulkarni [this message]
2023-03-06 13:52 ` Sagi Grimberg
2023-03-06 13:57   ` Damien Le Moal
2023-03-06 14:00     ` Sagi Grimberg
2023-03-09  9:42 ` Christoph Hellwig

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=4456fa26-affa-aa28-9837-e14375a8c4fa@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=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