CVE-2026-98115 PUBLISHED

ksmbd: safely drain sessions during logoff

Assigner: Linux
Reserved: 25.09.2026 Published: 25.09.2026 Updated: 25.09.2026

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.

Metrics

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.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 76e98a158b207771a6c9a0de0a60522a446a3447 to a7e6df0bb92642bee4431b2b85c69ada1e463b21 (excl.)
  • affected from 76e98a158b207771a6c9a0de0a60522a446a3447 to d12168084c8c1b6d883c8eca5853929ac5136a9e (excl.)
  • Version 118fd997612d1efc94a86c307c6c6d659ebe29fc is affected
  • Version c1e55020534c4aafbc38d8f5c4583ff30755ac18 is affected
  • affected from 6.6.48 to 6.7 (excl.)
  • affected from 6.10.7 to 6.11 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.11 is affected
  • unaffected from 0 to 6.11 (excl.)
  • unaffected from 7.2.7 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References