stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH stable-5.0+ 2/3] nvme-tcp: fix possible null deref on a timed out io queue connect
Date: Mon, 10 Jun 2019 16:41:50 -0400	[thread overview]
Message-ID: <20190610204150.GA1655@sasha-vm> (raw)
In-Reply-To: <20190610045826.13176-2-sagi@grimberg.me>

On Sun, Jun 09, 2019 at 09:58:25PM -0700, Sagi Grimberg wrote:
>Upstream commit: Fixes: d10325e5a9ca ("nvme-tcp: fix possible null deref
>on a timed out io queue connect"

Upstream commit here is f34e25898a608 :)

--
Thanks,
Sasha

>If I/O queue connect times out, we might have freed the queue socket
>already, so check for that on the error path in nvme_tcp_start_queue.
>
>Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> drivers/nvme/host/tcp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
>index 2405bb9c63cc..2b107a1d152b 100644
>--- a/drivers/nvme/host/tcp.c
>+++ b/drivers/nvme/host/tcp.c
>@@ -1423,7 +1423,8 @@ static int nvme_tcp_start_queue(struct nvme_ctrl *nctrl, int idx)
> 	if (!ret) {
> 		set_bit(NVME_TCP_Q_LIVE, &ctrl->queues[idx].flags);
> 	} else {
>-		__nvme_tcp_stop_queue(&ctrl->queues[idx]);
>+		if (test_bit(NVME_TCP_Q_ALLOCATED, &ctrl->queues[idx].flags))
>+			__nvme_tcp_stop_queue(&ctrl->queues[idx]);
> 		dev_err(nctrl->device,
> 			"failed to connect queue: %d ret=%d\n", idx, ret);
> 	}
>-- 
>2.17.1
>

  reply	other threads:[~2019-06-10 20:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10  4:58 [PATCH stable-5.0+ 1/3] nvme-tcp: rename function to have nvme_tcp prefix Sagi Grimberg
2019-06-10  4:58 ` [PATCH stable-5.0+ 2/3] nvme-tcp: fix possible null deref on a timed out io queue connect Sagi Grimberg
2019-06-10 20:41   ` Sasha Levin [this message]
2019-06-10  4:58 ` [PATCH stable-5.0+ 3/3] nvme-tcp: fix queue mapping when queue count is limited Sagi Grimberg
2019-06-13  7:45   ` Greg KH
2019-06-14 13:29     ` Sagi Grimberg
2019-06-14 13:40       ` Greg KH
2019-06-14 13:40         ` Greg KH
2019-06-13  7:44 ` [PATCH stable-5.0+ 1/3] nvme-tcp: rename function to have nvme_tcp prefix Greg KH

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=20190610204150.GA1655@sasha-vm \
    --to=sashal@kernel.org \
    --cc=sagi@grimberg.me \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).