From: Stefan Metzmacher <metze@samba.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: metze@samba.org, Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>,
ChenXiaoSong <chenxiaosong@chenxiaosong.com>,
linux-cifs@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 0/2] smb: server: fix the nonce of encrypted responses and a listener leak
Date: Fri, 27 Nov 2026 17:48:57 +0100 [thread overview]
Message-ID: <cover.1795797772.git.metze@samba.org> (raw)
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
next reply other threads:[~2026-11-27 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 16:48 Stefan Metzmacher [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1795797772.git.metze@samba.org \
--to=metze@samba.org \
--cc=chenxiaosong@chenxiaosong.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox