The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/4] smb: server: Clear sensitive data before freeing it
@ 2026-08-10 12:58 Thomas Huth
  2026-08-10 12:58 ` [PATCH 1/4] smb: server: Clear sensitive stack and heap data in auth.c Thomas Huth
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Huth @ 2026-08-10 12:58 UTC (permalink / raw)
  To: Namjae Jeon, Steve French
  Cc: Sergey Senozhatsky, Tom Talpey, linux-cifs, linux-kernel

Sensitive data like keys that are stored in stack-local arrays could be
leaked via the stack to the calling functions, or via the heap when using
only normal kfree() functions.

It's good security practice to clear sensitive data on the stack first
with memzero_explicit() before leaving the context, and to use
kfree_sensitive() for data that is returned to the heap.

Disclaimer: The spots that need clearing have been identified with AI,
but the patches have been created manually (for double-checking whether
the findings really make sense). Anyway, I'm not very familiar with the
smb code, so please review carefully. Thanks!

Thomas Huth (4):
  smb: server: Clear sensitive stack and heap data in auth.c
  smb: server: Make sure that passkey is not leaked on the heap in
    user_config.c
  smb: server: Free session data with kfree_sensitive() to avoid leaking
    of data
  smb: server: Free sensitive connection data with kfree_sensitive()

 fs/smb/server/auth.c              | 11 +++++++++--
 fs/smb/server/connection.c        |  4 ++--
 fs/smb/server/mgmt/user_config.c  |  6 +++---
 fs/smb/server/mgmt/user_session.c |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-10 12:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 12:58 [PATCH 0/4] smb: server: Clear sensitive data before freeing it Thomas Huth
2026-08-10 12:58 ` [PATCH 1/4] smb: server: Clear sensitive stack and heap data in auth.c Thomas Huth
2026-08-10 12:58 ` [PATCH 2/4] smb: server: Make sure that passkey is not leaked on the heap in user_config.c Thomas Huth
2026-08-10 12:58 ` [PATCH 3/4] smb: server: Free session data with kfree_sensitive() to avoid leaking of data Thomas Huth
2026-08-10 12:58 ` [PATCH 4/4] smb: server: Free sensitive connection data with kfree_sensitive() Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox