HIGH Introduced in 7.3
ksmbd SessionProcfs UAF
CVE-2026-99280
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: drain session procfs readers before dropping table references Session registration failure and connection cleanup can drop the table reference while the per-session procfs entry is still accessible. If a reader holds the last remaining reference, its final put calls proc_remove() from its own callback and waits for that callback to finish. Remove the procfs entry before dropping the table reference in the registration failure path. Queue sessions removed during connection cleanup and drain their procfs readers after releasing both session locks, then return their table references. Keep the global hash node unhashed while a session is queued so a concurrent unregister cannot drop the reference again. Previous-session replacement also destroys the file table before the session is finally freed. Detach the idr under the lock used by procfs file counters, and report zero files after it has been detached. This prevents a reader from accessing the idr during or after its destruction.
02KernelScan AI Analysis
Risk summary
A remote attacker connecting to a ksmbd SMB server can trigger a use-after-free in the kernel by racing session cleanup against procfs reads of session information. Successful exploitation allows arbitrary kernel memory read and write, leading to full kernel compromise. Systems running the ksmbd kernel SMB server exposed to untrusted networks are at risk.
Vulnerability analysis
The ksmbd kernel SMB server creates per-session procfs entries that expose session file tables. During session registration failure or connection teardown, the server would drop its reference to the session's file table (an IDR) while the procfs entry remained accessible. A concurrent procfs reader holding the last reference could then trigger a use-after-free when the file table was freed underneath it, or deadlock when the final reference release called proc_remove() from within the procfs callback. The fix removes the procfs entry before dropping the table reference in the failure path, queues sessions for deferred disposal during connection cleanup so that procfs readers are drained after locks are released, and detaches the file table IDR under the lock that protects procfs reader counters — setting it to NULL before destruction so readers see zero files instead of accessing freed memory.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 7.2.8 | 7.3 | 6789f0983f8e |
| 7.3 | 7.3 | 7.3.2 | 1c087cf7d538 |
| mainline | 7.3 | 7.4-rc1 | — |