Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A3ED01DA0E1; Mon, 23 Mar 2026 16:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282934; cv=none; b=hqF7ncdME8jVITfbwZPSGAUfweVGXqrAJNMRbAHi8jSvHke5ajD1Ma7jI92fl6vCwpVyY7LUZhWywx+4k9KxmSZo6yzbbstdzRnaMESpW2pkgjK+f19ieyyXnB+O0Mt1aX4ybOpdVX3R+Z+ubhRXA1DTlAsm2AlTqBPU71FbRxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282934; c=relaxed/simple; bh=I9Y9NN8bVgp8JDR1ER8kWCPyzT7c2sjtOxE8pfwcG4s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cZMKaz09t4r5i4LKkdLUF3CLlIJ6AtFgCNjDcaWlNiUh7fCMwBmw5FEhr4WB4M2FDxx9Vfja3Br6WVaajl0Le92a7+FpujBdy0/3PnAfzih+z2NO/99PA/9xRtqFI7fudZWliN2LO+ftwr4x7bBb7sLyGvj6uAUvUqkCRxATItQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RDeL8zfp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RDeL8zfp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0265EC4CEF7; Mon, 23 Mar 2026 16:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774282934; bh=I9Y9NN8bVgp8JDR1ER8kWCPyzT7c2sjtOxE8pfwcG4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RDeL8zfpmw+xvJmc3MfmNUp5dYJzH+66u/sRnKFruLwKekMxMzVImgyjTAz8giHPT 3P10Vz3P7140dDAnQXaYRvpoNzo/wWTDtqxBgwAnbBWW6swxa/wuDsonfuwLosLfOW hvRrwEYrE6EsuXyAtvrEiOlPbwL5Q1GOTfWYCNt0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thorsten Blum , Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 6.1 341/481] ksmbd: Dont log keys in SMB3 signing and encryption key generation Date: Mon, 23 Mar 2026 14:45:23 +0100 Message-ID: <20260323134533.406453204@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thorsten Blum [ Upstream commit 441336115df26b966575de56daf7107ed474faed ] When KSMBD_DEBUG_AUTH logging is enabled, generate_smb3signingkey() and generate_smb3encryptionkey() log the session, signing, encryption, and decryption key bytes. Remove the logs to avoid exposing credentials. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Thorsten Blum Acked-by: Namjae Jeon Signed-off-by: Steve French [ Context ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/smb/server/auth.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -795,12 +795,8 @@ static int generate_smb3signingkey(struc if (!(conn->dialect >= SMB30_PROT_ID && signing->binding)) memcpy(chann->smb3signingkey, key, SMB3_SIGN_KEY_SIZE); - ksmbd_debug(AUTH, "dumping generated AES signing keys\n"); + ksmbd_debug(AUTH, "generated SMB3 signing key\n"); ksmbd_debug(AUTH, "Session Id %llu\n", sess->id); - ksmbd_debug(AUTH, "Session Key %*ph\n", - SMB2_NTLMV2_SESSKEY_SIZE, sess->sess_key); - ksmbd_debug(AUTH, "Signing Key %*ph\n", - SMB3_SIGN_KEY_SIZE, key); return 0; } @@ -864,23 +860,9 @@ static int generate_smb3encryptionkey(st if (rc) return rc; - ksmbd_debug(AUTH, "dumping generated AES encryption keys\n"); + ksmbd_debug(AUTH, "generated SMB3 encryption/decryption keys\n"); ksmbd_debug(AUTH, "Cipher type %d\n", conn->cipher_type); ksmbd_debug(AUTH, "Session Id %llu\n", sess->id); - ksmbd_debug(AUTH, "Session Key %*ph\n", - SMB2_NTLMV2_SESSKEY_SIZE, sess->sess_key); - if (conn->cipher_type == SMB2_ENCRYPTION_AES256_CCM || - conn->cipher_type == SMB2_ENCRYPTION_AES256_GCM) { - ksmbd_debug(AUTH, "ServerIn Key %*ph\n", - SMB3_GCM256_CRYPTKEY_SIZE, sess->smb3encryptionkey); - ksmbd_debug(AUTH, "ServerOut Key %*ph\n", - SMB3_GCM256_CRYPTKEY_SIZE, sess->smb3decryptionkey); - } else { - ksmbd_debug(AUTH, "ServerIn Key %*ph\n", - SMB3_GCM128_CRYPTKEY_SIZE, sess->smb3encryptionkey); - ksmbd_debug(AUTH, "ServerOut Key %*ph\n", - SMB3_GCM128_CRYPTKEY_SIZE, sess->smb3decryptionkey); - } return 0; }