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=1796381281; b=5OdIvWDqWH+4ZYQlOITiZ3ITw3sP/dC3SH+TEyNDyT4jDFmTH/+vS62IpwRZIsmftegL 7sguklGGEr2XqJexvcB0PKJnaRGGM5yuRKYRFCF29ulO43xhqW+GSjgmN26QcDeWgGt1v Qw1lnncJvEDCBpfftu2NEJ2UMcxi7s+ov0eI4eDMH+DSkiYVmc9aFC95AO9Q4wK7XmDFR AENUH3YUwSpTdUtTBiE9ZGkiZTdu6g2xf6QVhnFx7rbX4oVNhSM6rg1kQdrrV+NxCUrsi p+7R98h49a4WngvV6tYgQhDn6EtcO6nMvqEMtd7hv52KABuer7zm4Em9Lnj31uVZgzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381281; 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=Qq7UuCwvAYnMBRLGR46Cn1s+b76hu9CG/rvbqs1Lflk=; b=0uqYWwnhaPZ17nqY0psUTVshhGL6vMbDMEYrn4vyiN49SBmWuChLQsIUEu9UPrA8kam7 V8H3TNPlnDpTaHx+dibpEarV7o47z4cvgPQbblL5mzNrGBNTCsucqEw5UUPHnA9KyJzv2 6HYnXxdbvBCdl6uTQ70Pga8hanposcmwsMyvdL4Np8IfAkJ1V5aqddM0iVfmN7883h6TU fAHNI5gDFANvPug/p9QL+b0W4WwObRtwnFcEuPGGsnuPRphdhceEkdRKEeDNeMCXVpNQw lpVY+d7qaGpu7R3ZSkWa9+x+1fGTxnAZ7IRr7E8JNbrGEuwghw4CO75lnkzWH2+7Kaw== 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=OmhrYZgs; 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 38F09606A69B; Fri, 4 Dec 2026 10:48:01 +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=OmhrYZgs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84AEC1F0092C; Fri, 4 Dec 2026 10:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381280; bh=Qq7UuCwvAYnMBRLGR46Cn1s+b76hu9CG/rvbqs1Lflk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OmhrYZgsFBIdtnpOyq7T13KZR9ACTiAoNFI75DLTsAB5W3AE7McJFnbwIPdPsph16 Rf5TUM8p3Py6ZS76qdjdnqMiRDEW8khVogubYwQJc97F4PsZkT7fgmp9G3kM5EBqZg qPMQMFp39Z3q6Ci+2KtAd96vBRiDxtmFljWHwlLo= 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 7.3 637/742] nvme-tcp: require the R2T offset to match the data sent Date: Fri, 4 Dec 2026 19:08:21 +0900 Message-ID: <20261204100652.016754004@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 @@ -838,7 +838,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);