Re: [PATCH] ksmbd: build a response when the connection state stops a request

From: Ian Bridges

Date: Tue Dec 01 2026 - 10:05:13 EST


I can confirm both problems that Sashiko reported for this patch.

The tests ran on ksmbd-for-next 87ff512becd4 on x86_64 with KASAN. A
client logged in as a normal user over SMB 3.1.1 with AES-CMAC
signing. The session did not require signing. The client held an
exclusive byte-range lock on one handle of a file. On a second handle
of the file it sent a signed compound of a LOCK that blocks on that
range and a NEGOTIATE. A second connection then sent a SESSION_SETUP
as the same user with the PreviousSessionId of the first session.

In the first test the NEGOTIATE had the SIGNED flag and a random
signature. With the patch the NEGOTIATE got a
STATUS_CONNECTION_DISCONNECTED response that verified under the
signing key of the session. Without the patch no response was signed
for it.

In the second test the NEGOTIATE had a CreditCharge of 65535. With the
patch the compound response ended with the 73-byte error response of
the NEGOTIATE twice. Without the patch that error response appeared
once.