Re: [PATCH v2 0/4] ksmbd: verify session setup requests before signing with their key

From: Namjae Jeon

Date: Fri Nov 06 2026 - 20:30:57 EST


On Sat, Nov 7, 2026 at 4:06 AM Michail Andreas Michalopoulos
<mike.michalo@xxxxxxxxx> wrote:
>
> ksmbd signs some SESSION_SETUP and error responses with a session's key
> without having verified the request, which lets a peer that does not hold
> the key obtain signatures made with it. This series fixes those cases and
> makes ksmbd sign with the SMB 3.1.1 signing algorithm it negotiated.
>
> 1/4 verifies multichannel binding requests with the session signing key
> (MS-SMB2 3.3.5.2.4), as reported by Ian Bridges.
> 2/4 keeps the negotiated SMB 3.1.1 signing algorithm instead of always
> using AES-CMAC, and signs each key with its own algorithm.
> 3/4 verifies signed reauthentication requests and uses the channel key
> for session setup on a bound channel. A reauthentication with a
> forged signature used to get a response signed with the session key.
> 4/4 checks the MessageId and signature of a request before signing
> STATUS_NETWORK_SESSION_EXPIRED, also reported by Ian Bridges.
>
> Changes since v1:
> - 1/4 is new: verify the signature of session binding requests, as
> reported by Ian Bridges.
> - 2/4 (v1 1/2): reset the negotiated signing state on every NEGOTIATE;
> Cc stable, since 3/4 depends on it.
> - 3/4 and 4/4 are new.
> - The AES-GMAC signing patch (v1 2/2) is dropped from this series and
> will be posted separately.
>
> Testing, on a KASAN/lockdep UML kernel with ksmbd-tools: forged and
> replayed binding, reauthentication and expired-session requests, also
> inside compounds, get unsigned refusals with AES-CMAC and HMAC-SHA256;
> randomized requests against these paths and concurrent bind/reauth/
> logoff stress found no signed response to an unverified request and no
> KASAN or lockdep report; the Linux cifs client works with SMB 2.1 to
> 3.1.1, signed and encrypted; smbtorture's session, signing, I/O,
> compound, lock, oplock, lease, notify and ioctl suites give the same
> results as without the series. Ian Bridges also tested an earlier
> revision with his own probes and smbtorture. Not tested: Windows
> clients, and Kerberos expiry with a real KDC (it was emulated with a
> test-only change).
>
> An AI assistant was used to draft the patches and as an independent
> reviewer.
>
> Michail Andreas Michalopoulos (4):
> ksmbd: verify the signature of session binding requests
> ksmbd: sign with the negotiated SMB 3.1.1 signing algorithm
> ksmbd: use the channel signing key for session setup on a bound
> channel
> ksmbd: check a request before signing STATUS_NETWORK_SESSION_EXPIRED

Sashiko’s review mixes pre-existing issues with problems introduced by
this series. I’m fine with addressing just the issues in patch 3/4 for
the next version. It would also be reasonable to extend this series
with separate patches fixing the pre-existing issues Sashiko found.

https://sashiko.dev/#/patchset/20261106190622.20990-1-mike.michalo%40gmail.com

Thanks.