From 111a2b8717efbd9729d36828308d5163fdc977c3 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 12 Aug 2026 15:01:52 +0200 Subject: [PATCH] smb: client: Avoid leaking sensitive data to the heap in connect.c TCP_Server_Info contains a preauth_sha_hash[] and a cryptkey[] array that might contain sensitive data. Thus free its memory with kfree_sensitive() to avoid that we are leaking this information to the heap. Signed-off-by: Thomas Huth Signed-off-by: Namjae Jeon Signed-off-by: Paulo Alcantara --- fs/smb/client/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index f9764f65430e..bcd7f1ae99ba 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -1143,7 +1143,7 @@ clean_demultiplex_info(struct TCP_Server_Info *server) put_net(cifs_net_ns(server)); kfree(server->leaf_fullpath); kfree(server->hostname); - kfree(server); + kfree_sensitive(server); length = atomic_dec_return(&tcpSesAllocCount); if (length > 0)