Re: [PATCH] ksmbd: fix out-of-bounds read in expired-session LOCK check
From: Michail Andreas Michalopoulos
Date: Thu Nov 12 2026 - 00:16:53 EST
On top of linux-next 20261105 with the four newer ksmbd-for-next commits
up to a4277e7b7682, under KASAN, with session expiry forced by a
test-only hook as in your notes. With well-formed requests on an expired
session, before and after the patch:
- an unlock succeeds and releases the range; another client can then
lock it
- a new lock, and a request that unlocks one range and locks another,
both return STATUS_NETWORK_SESSION_EXPIRED and change nothing
- a compound of an unlock and a lock returns STATUS_SUCCESS and
STATUS_NETWORK_SESSION_EXPIRED
- READ is refused; CLOSE and LOGOFF succeed
These results are the same with and without the patch, with no KASAN
reports.
I did not test the malformed request itself.
One difference, for the better: a LOCK with a bad signature on an
expired session now goes through the signature check in
__process_request(), so it gets an unsigned STATUS_ACCESS_DENIED instead
of a STATUS_NETWORK_SESSION_EXPIRED signed with the session's key. Patch
5/8 of my v5 signing series fixes the same thing for the other commands;
the two patches do not overlap.
Tested-by: Michail Andreas Michalopoulos <mike.michalo@xxxxxxxxx>