[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7fe8282a-8fc4-47e7-b7bf-b1686d78e9ef@grimberg.me>
Date: Fri, 24 Jan 2025 00:04:06 +0200
From: Sagi Grimberg <sagi@...mberg.me>
To: Caleb Sander Mateos <csander@...estorage.com>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvme-tcp: check that full ICResp is received
On 23/01/2025 19:48, Caleb Sander Mateos wrote:
> nvme_tcp_init_connection() attempts to receive an ICResp PDU but only
> checks that the return value from recvmsg() is non-negative. If the
> sender closes the TCP connection or sends fewer than 128 bytes, this
> check will pass even though the full PDU wasn't received.
>
> Ensure the full ICResp PDU is received by checking that recvmsg()
> returns the expected 128 bytes.
>
> Additionally set the MSG_WAITALL flag for recvmsg(), as a sender could
> split the ICResp over multiple TCP frames. Without MSG_WAITALL,
> recvmsg() could return prematurely with only part of the PDU.
Thanks Caleb, this looks good.
I think we want to adjust the title to express that this is a bug fix,
as well
as adding a fixes tag - so it can be picked up by stable kernels as back as
possible.
The title can perhaps be:
nvme-tcp: Fix possible connection establishment failure when receiving
partial ICResp PDUs
Powered by blists - more mailing lists