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=1796384060; b=rdHQ11zbZf6HE58NvwTaYpmr6QyKD5Ymx2K+hIWFSPwGIZ9428Qcikm40cXV8G51X6lX 5suI5JlKPRroUdi1mJtVWDOsJyBcRmELVqDg1hVn0q3xe/Sc3kKNMmtft/DaEDQHIpJgr CFBO1Irw343f1Kzf8MQp61yfwy2RjHk+x18Xt0slfuepCoUgP8FQHr0jT7wAhqwQoFLEh 4yyZfdujgx/ex8qoeWt+0BzwSsDqga0Y53QFnBZ9itmNnGiB4uwTZFNouwAfNat/SwzKL 4hv1lZCTw3K6aqsEVAKISlH5KXheWN3Hu5K3doHZn9Wjw0YgHLSVM67IIEjX0MogtWg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384060; 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=UhGGL8HA4H2Yyi+s5MFvHitB0ImZKrX8+Tb3z5XLZj4=; b=iXc8o5zxTh6M3J8MnfRlqKnYXzmbNm7GcALTOQ/PwN6hsxjicVDkopDPvClR3MV53eKx gLzTK/0P6Sx+Rnv+du+dH3VUhQR2CBVfYquFVveS90zLi6Y6PQFwdWVoSIOIhGGKE19EV 5YvLeEp+7hxY8RSTEpzaDHSCcFHvMWBnbxU4g9ro7WshQEgs1dzh9IsLXACkvQwa1JOxP F4PZJiDsY1Lom/inyfcz1wrG+U6QAa76Lh22JgvHTTZtINcH00z3E8RJFeq/bNNKC5Ung XBg5qZ1R2U6RLsLv99JdsC/ILtseJUtcZmUKS8Vdm20E8mnnJ1NKj9VCnSIVvwGzNnA== 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=hkRdHOxV; 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 2C699606A32C; Fri, 4 Dec 2026 11:34:20 +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=hkRdHOxV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D87F1F000C2; Fri, 4 Dec 2026 11:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384060; bh=UhGGL8HA4H2Yyi+s5MFvHitB0ImZKrX8+Tb3z5XLZj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hkRdHOxVd3G0CIPbj3O1tdno6uTahT0oalyjDHWmOGRa+VV52umWxYV4/1blNYD6S 6jaQhHdxhqx+ODf7LSjuvzuhSRCFuiAX+0S+b4tEmmWEP/h8bazGXT2K7J3mKrnpHC 72kll5NaSsBfKVGSV0PthBONce2OTc2m/rr4tzD8= 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.12 478/555] nvme-tcp: require the R2T offset to match the data sent Date: Fri, 4 Dec 2026 19:08:41 +0900 Message-ID: <20261204100627.406967807@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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 @@ -839,7 +839,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);