From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B09224071DA; Sun, 7 Jun 2026 10:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780827383; cv=none; b=Z9AWvTD24qwDP4Mf5R8oam294APXBHS8B+tovqTnuxyXgKG3/vyWFjdVt4TMoodLLDxONiN78GdAQvFrA6mv/2XiHsvpBlypsxLV1fHgbky1BARg9MjlXKIvWCyKS3skHaqT60dhx/Ud2jT2PKcpuXhwujfA1ybJJOeQjqZ2QoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780827383; c=relaxed/simple; bh=fhRIfYWgfBWjKMa/fs5+t/iMX/u/a5+PuGt2DYJje7U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=udetMaBhC2JBq/ipOe36mwWQEM8HTXxR8FbqN0JE4KvPD1XHorEDXm1RFx2nAg/QConNtryP3GN0GnsKEpWWWuinfILn6EHlIpXbQYWb0Kiwu9Q6RwyZmE9mq5FTSx4vK/Y6KUxrQs0z6Btq6YyWwYk+QzcGSK7sci0K3iFx0Ck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IA6+dWgJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IA6+dWgJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C609E1F00893; Sun, 7 Jun 2026 10:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780827382; bh=vqNZ+lXCRWd/21wKoLternjWv0QdrrItPtmMqqT2Wfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IA6+dWgJDujYCchVaWam7hpJVHKyqQh2qp0UlWDLuru6/MNKGb/KtSoL6q2I2U4u4 0kc1fFs20Of69fF6RBOsJuNd4XLw64V4iBYsMw3XCNC4dKSz6iwAT9NQV4RWShoPRY vRN7okNsochJOAcuIQIu6DZflhCqu3x6eU87YldQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chuck Lever , Hannes Reinecke , Alistair Francis , Paolo Abeni , Sasha Levin Subject: [PATCH 7.0 088/332] nvme-tcp: store negative errno in queue->tls_err Date: Sun, 7 Jun 2026 11:57:37 +0200 Message-ID: <20260607095731.378914817@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095728.031258202@linuxfoundation.org> References: <20260607095728.031258202@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chuck Lever [ Upstream commit 9015985b5eb1a90eb86caf5bce1dfcf1aa38f8ad ] nvme_tcp_tls_done() assigns queue->tls_err in three branches. The ENOKEY lookup failure and the EOPNOTSUPP initializer both store negative errnos. The third branch, reached when the handshake layer reports a non-zero status, stores -status. The handshake layer delivers status to the consumer callback as a negative errno; the other in-tree consumers -- xs_tls_handshake_done() and the nvmet target callback -- treat their status argument that way. The extra negation in nvme_tcp_tls_done() flips the sign, leaving tls_err as a positive value (for instance, +EIO), which nvme_tcp_start_tls() then returns to its caller. Drop the extra negation so queue->tls_err uniformly carries a negative errno on failure. Fixes: be8e82caa685 ("nvme-tcp: enable TLS handshake upcall") Signed-off-by: Chuck Lever Reviewed-by: Hannes Reinecke Reviewed-by: Alistair Francis Link: https://patch.msgid.link/20260525-handshake-file-pin-v3-2-66c616906ead@oracle.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 243dab830dc84f..29f9ba0bdd3f1e 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1688,7 +1688,7 @@ static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid) qid, pskid, status); if (status) { - queue->tls_err = -status; + queue->tls_err = status; goto out_complete; } -- 2.53.0