[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba517afc-c99c-4712-9166-bed9958e6124@suse.de>
Date: Wed, 6 Sep 2023 13:23:14 +0200
From: Hannes Reinecke <hare@...e.de>
To: Daniel Wagner <dwagner@...e.de>, linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, Sagi Grimberg <sagi@...mberg.me>,
Jason Gunthorpe <jgg@...pe.ca>,
James Smart <james.smart@...adcom.com>,
Chaitanya Kulkarni <kch@...dia.com>,
Christoph Hellwig <hch@....de>
Subject: Re: [RFC v1 4/4] nvmet-discovery: do not use invalid port
On 8/29/23 11:13, Daniel Wagner wrote:
> The port entry binding might not be existing and thus the req->port
> pointer is not valid.
>
> Reproducer: nvme/005 with active system nvmf-autoconnect systemd service.
>
> Signed-off-by: Daniel Wagner <dwagner@...e.de>
> ---
> drivers/nvme/target/discovery.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
> index 668d257fa986..fc113057cb95 100644
> --- a/drivers/nvme/target/discovery.c
> +++ b/drivers/nvme/target/discovery.c
> @@ -191,6 +191,15 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)
> goto out;
> }
>
> +
> + /* No port assigned, portentrybinding is missing */
Missing space.
> + if (!req->port) {
> + req->error_loc =
> + offsetof(struct nvme_get_log_page_command, lpo);
> + status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
> + goto out;
> + }
> +
> /*
> * Make sure we're passing at least a buffer of response header size.
> * If host provided data len is less than the header size, only the
Otherwise looks good.
Cheers,
Hannes
Powered by blists - more mailing lists