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 <thuth@redhat.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
This commit is contained in:
Thomas Huth
2026-08-12 15:01:52 +02:00
committed by Paulo Alcantara
parent 2f9af06e30
commit 111a2b8717

View File

@@ -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)