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 0C90248035F; Tue, 25 Aug 2026 13:31:15 +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=1787664677; cv=none; b=eu5l083TYSiKWzJePwW+eI7gSnJKBeQCw3uDNBbxKFUURZ3UQjloT/cO63uzAqfUE1DpTh9dt4BPCP+z4dDjVUIgx4Cei0Sucx9/kKuhOcukF6q15X7Hny1vs6KYTgcC7ThPNLSPkVM0S4jl5PEuv/53eH1km8SegUrlvH5kMJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787664677; c=relaxed/simple; bh=NWi6ssOiNkDJ0PhDLFIVRlEPfAYiNUv3A3JyTE/sHuc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G47Na7B5YNPOCpibZdKtuaFiCqK9vBn85LA9H/DCEeslNa33qb8tl4VFTFo2sNQOnsvYSIyBREKM5o+8b3olPsnKGXqNqpJRoYhtJMNs+R50DhdHAv564dc2gDNp8Xvj/dKk3hjS9u2ZQx896XQZWjWy/newvREenBFR7kVc5ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=l9cKiVCl; 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="l9cKiVCl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A4671F000E9; Tue, 25 Aug 2026 13:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787664675; bh=fiRRoMFxEKUlYWgcJe3q2Ksva7t4J90vkj+LbOioDRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l9cKiVCl4Nf7hUiulb2m6pzAgmxIVoE4M/LHapDOW/fVDogKUotkt5iPaM9r8dD/x QtT2PzcRmFNC9A+oSVs+0aEGCV+Qs8mA/J+D4hRiq6K1KZvei0/+VKG5qbXHZxKwkG IOjJEzP4sFMSVP6s9DJDOkjodQpmNkzD+zZMVvYo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bryam Vargas , Christoph Hellwig , Keith Busch Subject: [PATCH 7.2 50/82] nvmet-auth: zero the AUTH_RECEIVE response buffer Date: Tue, 25 Aug 2026 15:25:37 +0200 Message-ID: <20260825132543.479354216@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260825132541.560541185@linuxfoundation.org> References: <20260825132541.560541185@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.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bryam Vargas commit 3ddcfb013322aa37eaa7a0d344b73079c38dfa21 upstream. nvmet_execute_auth_receive() allocates the response buffer with kmalloc() sized by the host-supplied AUTH_RECEIVE allocation length, but the DH-HMAC-CHAP builders write only a fixed-size message into it. The full allocation length is then copied to the wire by nvmet_copy_to_sgl(), so a remote initiator receives the bytes past the built message -- up to nearly a page of uninitialized slab -- during the pre-authentication handshake. Allocate the buffer with kzalloc() so the unwritten tail is zeroed before it is sent; conforming responses are unaffected. Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Cc: stable@vger.kernel.org Signed-off-by: Bryam Vargas Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/target/fabrics-cmd-auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nvme/target/fabrics-cmd-auth.c +++ b/drivers/nvme/target/fabrics-cmd-auth.c @@ -557,7 +557,7 @@ void nvmet_execute_auth_receive(struct n return; } - d = kmalloc(al, GFP_KERNEL); + d = kzalloc(al, GFP_KERNEL); if (!d) { status = NVME_SC_INTERNAL; goto done;