From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382689; b=XXo72pbTtqvWByDa36Dd7EmmlJakS9CmFsbIlsVvBYkuk/pXUmMb48PlgQBpk5/aBF2C +8rbd75YVDYbD0JOqTuW5jy5KcO25Uz/uA3zu/z8r/xJEodgx1KjSpq2NZpHm8onX3K7/ p/n7aTZ1oyctIBz1DoZRFrJjVUKKeI+u+kjwLXtRZvsvvzKFFlo7Z8mi9XB9v2PzKV/8m WfkkKdhQzVPVBkjfhEj1bE+I96s47LZR1KUet59tdSJbedo3xJ8062l+4SfP68Ae+o4I0 /fluxUzKgACMwGPU2bDA4bygaGhOPMSE1r9M9UQnr4WTNzAgZSY3SAdXTz8W9aSMCbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382689; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=lOtjkXhrkwfTza7mooQjbz/SzrCy7jG8RUoFNQd5JSY=; b=jJw05SFevQE6Dt3NG2v4CX+ygGwNlxt5I7/F6OSQE7bCmZFzlMgXhwqWWWg1708KmQw/ dWmzzg7flbDrzIFbwCf+QVifFS4UgTcMe1bpqZppSAbjXt3kzWlZWLmnjJuWZu/FwQOIW 0kEFCftW/3QIbQtJP/PmAhpNn9bzgJsHdNj9V6pnd9bRSDMZmdgOd0a69PvyO/6+CFs4A a1bLf54pGnotcX0Zi/KSiKmNJaZ7Y8DkNYpzTl35Di6S7TAVHoHFRAO+2gcRdMw5nKDRt miP2X+6E6FMy5JRCUdQ8Jg/AR42YeIco7jsC+B7RMsp8WCb+I37DoAADThwpXFA7GVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uBtoR+fi; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9D2C606A322; Fri, 4 Dec 2026 11:11:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uBtoR+fi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9831F000C2; Fri, 4 Dec 2026 11:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382689; bh=lOtjkXhrkwfTza7mooQjbz/SzrCy7jG8RUoFNQd5JSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uBtoR+fig1rQKpORJc6FoX4nBz7P60IImexJPkrKmmhoF8iufC/iNgHzZl1NLH4ze PO2eXWMYwQHyLGPWhlUQMpt24qIebxw659T96xK8D9SETW8xXWj6aJoHOZq8xju3eT nUv+60RIRDzDTI1NxiK9xPJjJGxcRAQBKtW4EA0c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christoph Hellwig , Shao Mingyin , Keith Busch Subject: [PATCH 6.18 562/703] nvme-tcp: require the R2T offset to match the data sent Date: Fri, 4 Dec 2026 19:07:41 +0900 Message-ID: <20261204100642.725771341@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shao Mingyin commit 347d50d92e25d4b9c50c5f5c1d8b727b9c88d12c upstream. nvme_tcp_handle_r2t() rejects offsets below data_sent but accepts larger offsets. The send iterator still points at data_sent, so the next H2CData PDU carries bytes from that position while advertising the larger offset. A target that accepts the PDU can place the data at the wrong position; the Linux target rejects it and fails the connection. Require the R2T offset to equal data_sent, rejecting the invalid request before transmitting data with a mismatched offset. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -843,7 +843,7 @@ static int nvme_tcp_handle_r2t(struct nv return -EPROTO; } - if (unlikely(r2t_offset < req->data_sent)) { + if (unlikely(r2t_offset != req->data_sent)) { dev_err(queue->ctrl->ctrl.device, "req %d unexpected r2t offset %u (expected %zu)\n", rq->tag, r2t_offset, req->data_sent);