[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADUfDZrjXYH-42Q1-M88CmYo1fTi2Hu_66=vk8G3Gjqpuo+rCA@mail.gmail.com>
Date: Fri, 24 Jan 2025 09:33:16 -0800
From: Caleb Sander <csander@...estorage.com>
To: Maurizio Lombardi <mlombard@...hat.com>
Cc: Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] nvme-tcp: fix connect failure on receiving partial
ICResp PDU
Good catch! I will send a v3.
On Fri, Jan 24, 2025 at 12:08 AM Maurizio Lombardi <mlombard@...hat.com> wrote:
>
> čt 23. 1. 2025 v 23:50 odesílatel Caleb Sander Mateos
> <csander@...estorage.com> napsal:
> >
> > ret = kernel_recvmsg(queue->sock, &msg, &iov, 1,
> > iov.iov_len, msg.msg_flags);
> > - if (ret < 0) {
> > + if (ret < sizeof(*icresp)) {
> > pr_warn("queue %d: failed to receive icresp, error %d\n",
> > nvme_tcp_queue_id(queue), ret);
> > goto free_icresp;
> > }
>
> There is a small problem here, suppose ret is a positive number but
> smaller than sizeof(*icresp),
> you will print a bogus error code, then you "goto free_icresp;" and
> return this random positive number to the caller.
>
> I think that if ret > 0 you should set it to -EINVAL.
>
> Maurizio
>
Powered by blists - more mailing lists