Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] smb: server: fix the nonce of encrypted responses and a listener leak
@ 2026-11-27 16:48 Stefan Metzmacher
  2026-11-27 16:48 ` [PATCH 1/2] smb: server: use a counter for the nonce of encrypted responses Stefan Metzmacher
  2026-11-27 16:48 ` [PATCH 2/2] smb: server: don't leak the smbdirect listener socket on errors Stefan Metzmacher
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Metzmacher @ 2026-11-27 16:48 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: metze, Sergey Senozhatsky, Tom Talpey, ChenXiaoSong, linux-cifs,
	stable

Hi Namjae,

these are fixes for ksmbd:

  - The nonce of encrypted responses and of the payload of encrypted
    RDMA reads is a 64-bit counter of the session followed by random
    bits of the session, like Samba does, instead of random bytes,
    which only made a reuse unlikely. With AES-GCM a reused nonce
    reveals the authentication key.

  - smb_direct_listen() leaked the smbdirect socket if binding or
    listening failed, e.g. with -EADDRINUSE (reported by Sashiko).

The client got the same nonce fix in the urgent client series, the
urgent smbdirect fixes are posted separately as well, they are all
independent of each other.

These patches were developed with the help of Claude (Anthropic),
which was used for code analysis, writing parts of the code and the
commit messages. I reviewed all changes and take full responsibility
for them.

Testing: on real hardware, client and server running the urgent
client, smbdirect and ksmbd series together:

  - encrypted (seal) mounts over TCP and over RDMA (RoCE with mlx5
    and irdma) with AES128-GCM and data verification
  - ksmbd started while the RDMA port 445 is already in use,
    smbdirect_socket_bind() fails, no warnings and ksmbd starts again
    afterwards
  - the RDMA tests of the urgent smbdirect series, including 10 ksmbd
    restarts per device while I/O is running

As we are already late in the 7.4 cycle, I leave it up to you to
decide if they should still go into 7.4 or into the next merge
window, both are marked for stable.

Base: v7.4-rc4, like the other smb series. The patches also apply
cleanly (git am) on cifs-next (61c581ea62ee), on ksmbd-for-next
(3c31349456c5) and on both merged, with or without the urgent client
and smbdirect series, and build on both merged.

Stefan Metzmacher (2):
  smb: server: use a counter for the nonce of encrypted responses
  smb: server: don't leak the smbdirect listener socket on errors

 fs/smb/server/auth.c              | 43 +++++++++++++++++++++++++++++++
 fs/smb/server/auth.h              |  4 +++
 fs/smb/server/mgmt/user_session.c |  1 +
 fs/smb/server/mgmt/user_session.h |  3 +++
 fs/smb/server/smb2pdu.c           | 25 +++++++++++-------
 fs/smb/server/transport_rdma.c    |  2 +-
 6 files changed, 67 insertions(+), 11 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-27 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 16:48 [PATCH 0/2] smb: server: fix the nonce of encrypted responses and a listener leak Stefan Metzmacher
2026-11-27 16:48 ` [PATCH 1/2] smb: server: use a counter for the nonce of encrypted responses Stefan Metzmacher
2026-11-27 16:48 ` [PATCH 2/2] smb: server: don't leak the smbdirect listener socket on errors Stefan Metzmacher

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