HIGH Introduced in 7.3
ksmbd Session Leak
CVE-2026-99279
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: reclaim ended sessions on logoff and expiration LOGOFF and previous-session replacement leave sessions Expired with a zero credential expiry. Ended sessions can retain their memory and connection slots when no further setup arrives on the owning connection. Unpublish a logged-off session while the request reference keeps its response signing and encryption keys alive. Remove its procfs entry before dropping the table reference so a reader cannot remove its own entry on the last put. Clear proc_entry after removal to avoid removing it twice. Reclaim ended sessions from the global table in the existing expiration worker before it acquires conn_list_lock. Only select Expired sessions with zero credential expiry and no references beyond the table reference. Keep sessions whose Kerberos credentials expired available for reauthentication. Unlink the session from its setup connection and all channel connections, so SMB2 sessions and sessions with only secondary SMB3 channels are covered. The session already holds connection references, and sessions_table_lock prevents concurrent channel removal. Queue sessions on a separate disposal list, leaving their hash nodes unhashed, and remove procfs entries and drop table references outside the locks. Keep the pending setup check before allocating a new session so abandoned InProgress sessions can release their slots even at the connection limit. Retain the timeout and reference checks and dispose of those sessions outside the locks. Leave ended Expired sessions to the expiration worker.
02KernelScan AI Analysis
Risk summary
A network attacker can exhaust kernel memory and connection slots on an SMB server by repeatedly establishing and logging off sessions. Each logoff leaves a session object in an expired state that is never reclaimed, eventually preventing new connections. The vulnerability is reachable from any client that can reach the SMB service on TCP port 445.
Vulnerability analysis
When an SMB client logs off or starts a new session that replaces an existing one, the kernel SMB server (ksmbd) marks the old session as expired but fails to remove it from the global session table or free its memory. These ended sessions accumulate indefinitely, each consuming kernel memory and a connection slot. The fix adds a periodic reclamation pass in the existing expiration worker that scans for expired sessions with zero credential expiry and no remaining references, unlinks them from all connections, and safely disposes of them outside of locks. A secondary fix prevents a procfs entry from being removed twice during cleanup. Any remote client able to connect to the SMB port (TCP 445) can trigger this leak by performing repeated session setup and logoff operations; no authentication or local privileges are required.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 7.2.8 | 7.3 | 1767a5e45dbf |
| 7.3 | 7.3 | 7.3.2 | 26534ef335e9 |
| mainline | 7.3 | 7.4-rc1 | — |