In the Linux kernel, the following vulnerability has been resolved:
ksmbd: safely drain sessions during logoff
SMB3 multichannel allows requests for one session to run on multiple
connections. Wait for all channels bound to a session before freeing
shared session objects.
A deferred byte-range lock remains counted as a running request and only
wakes when its file closes. Wake blocked locks during the drain without
unpublishing or modifying their file objects. Synchronous CANCEL requests
must invoke their cancellation callback to wake pending operations, while
CHANGE_NOTIFY completion remains specific to the asynchronous path.
Serialize session teardown with channel registration and previous-session
cleanup, and use atomic work-state transitions so LOGOFF, CANCEL, and
connection teardown invoke cancellation callbacks only once.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 8.8
AV:N - The racing teardowns start from SMB2 messages that ksmbd receives over TCP/445. They are an SMB2 LOGOFF handled by smb2_session_logoff(), and a SESSION_SETUP carrying PreviousSessionId handled by destroy_previous_session(). Requests in flight on other bound channels are also affected. All of these are sent by the remote client.
AC:L - The attacker controls both sides of the race by opening several TCP connections to the same session. Before the fix, smb2_session_logoff() only waited for its own connection (ksmbd_conn_wait_idle). It also had no tearing_down guard against a concurrent destroy_previous_session() or a second LOGOFF, so the attacker can retry the race at will.
PR:L - Both LOGOFF and a PreviousSessionId reconnect need a valid authenticated session. destroy_previous_session() also checks that the user name and passkey match the previous session's user. So the attacker must be an ordinary authenticated SMB user, not an unauthenticated one.
UI:N - The attacker's own SMB requests on their own connections drive the whole sequence. No admin or victim action is needed.
S:U - The corruption stays within the kernel's own security authority: ksmbd session, file table and tree-connect objects. No hypervisor or IOMMU boundary is crossed.
C:H - The session's file table can be torn down while it is still in use. ksmbd_close_session_fds() and ksmbd_destroy_file_table() can run at the same time, and requests on other channels can still hold objects from the table being freed. That makes a use-after-free or double free of kernel heap objects, which a heap spray can turn into a memory read.
I:H - A use-after-free or double free of ksmbd_file and session objects reached from the network lets the attacker reallocate the freed memory with their own data. That can corrupt kernel memory and potentially hijack control flow.
A:H - Freeing session objects during concurrent teardown can oops or panic the kernel. Deferred byte-range locks that never wake can also hang the drain. The attacker can repeat either on demand.
| Attack Vector |
Network |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:N - The racing teardowns start from SMB2 messages that ksmbd receives over TCP/445. They are an SMB2 LOGOFF handled by smb2_session_logoff(), and a SESSION_SETUP carrying PreviousSessionId handled by destroy_previous_session(). Requests in flight on other bound channels are also affected. All of these are sent by the remote client.
AC:L - The attacker controls both sides of the race by opening several TCP connections to the same session. Before the fix, smb2_session_logoff() only waited for its own connection (ksmbd_conn_wait_idle). It also had no tearing_down guard against a concurrent destroy_previous_session() or a second LOGOFF, so the attacker can retry the race at will.
PR:L - Both LOGOFF and a PreviousSessionId reconnect need a valid authenticated session. destroy_previous_session() also checks that the user name and passkey match the previous session's user. So the attacker must be an ordinary authenticated SMB user, not an unauthenticated one.
UI:N - The attacker's own SMB requests on their own connections drive the whole sequence. No admin or victim action is needed.
S:U - The corruption stays within the kernel's own security authority: ksmbd session, file table and tree-connect objects. No hypervisor or IOMMU boundary is crossed.
C:H - The session's file table can be torn down while it is still in use. ksmbd_close_session_fds() and ksmbd_destroy_file_table() can run at the same time, and requests on other channels can still hold objects from the table being freed. That makes a use-after-free or double free of kernel heap objects, which a heap spray can turn into a memory read.
I:H - A use-after-free or double free of ksmbd_file and session objects reached from the network lets the attacker reallocate the freed memory with their own data. That can corrupt kernel memory and potentially hijack control flow.
A:H - Freeing session objects during concurrent teardown can oops or panic the kernel. Deferred byte-range locks that never wake can also hang the drain. The attacker can repeat either on demand.
CVSS 3.1