FAILED: patch "[PATCH] ksmbd: Don't log keys in SMB3 signing and encryption key" failed to apply to 5.15-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 441336115df26b966575de56daf7107ed474faed
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026031719-unranked-wrongdoer-d47a@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 441336115df26b966575de56daf7107ed474faed Mon Sep 17 00:00:00 2001
From: Thorsten Blum <[email protected]>
Date: Tue, 3 Mar 2026 14:25:53 +0100
Subject: [PATCH] ksmbd: Don't log keys in SMB3 signing and encryption key
generation
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.
fs/smb/server/auth.c +2 -20
@@ -589,12 +589,8 @@ static int generate_smb3signingkey(struct ksmbd_session *sess,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 ; }
@@ -652,23 +648,9 @@ static void generate_smb3encryptionkey(struct ksmbd_conn *conn, ptwin->decryption.context, sess->smb3decryptionkey, SMB3_ENC_DEC_KEY_SIZE); -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); - } } void ksmbd_gen_smb30_encryptionkey(struct ksmbd_conn *conn,
Sasha Levin
maintainerPATCH 1/1 ksmbd: Don't log keys in SMB3 signing and encryption key generation
From: Thorsten Blum <[email protected]>
[ 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.
--- fs/ksmbd/auth.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-)
fs/ksmbd/auth.c +2 -20
@@ -783,12 +783,8 @@ static int generate_smb3signingkey(struct ksmbd_session *sess,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 ; }
@@ -852,23 +848,9 @@ static int generate_smb3encryptionkey(struct ksmbd_conn *conn,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 ; }
Signature · 1 line
2.51.0