CVE-2026-99792 in Linux
Summary
by MITRE • 11/20/2026
In the Linux kernel, the following vulnerability has been resolved:
smb/server: prevent file publication after tree disconnect
TREE_DISCONNECT closes the tree's published file handles before marking and removing the tree connection. A concurrent CREATE that already holds a tree reference can therefore publish its file after the close pass. When CREATE drops its reference, the tree can be freed while the published file still points to it.
Mark and remove the tree connection before closing its files, and serialize both new-open and durable-reconnect volatile ID publication with that state transition. An opener is then either published in time for the close pass or rejected after disconnect with STATUS_NETWORK_NAME_DELETED.
Keep a tree reference while a file carries its tree pointer. This protects asynchronous users that can defer the file's final destruction past tree disconnect.
The close pass can race the successful FP_NEW to FP_INITED transition. Take the opening request's file reference atomically with that transition. This keeps the file alive until request completion even if teardown removes the ID immediately.
BUG: KASAN: slab-use-after-free in proc_show_files (fs/smb/server/vfs_cache.c:126) Read of size 4 at addr ff11000101540f80 by task poc/153
Call Trace: proc_show_files (fs/smb/server/vfs_cache.c:126) seq_read_iter (fs/seq_file.c:231) proc_reg_read_iter (fs/proc/inode.c:299) vfs_read (fs/read_write.c:574) ksys_read (fs/read_write.c:716) do_syscall_64 (arch/x86/entry/syscall_64.c:84) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
Allocated by: ksmbd_tree_conn_connect (fs/smb/server/mgmt/tree_connect.c:35) smb2_tree_connect (fs/smb/server/smb2pdu.c:2819) handle_ksmbd_work (fs/smb/server/server.c:368)
Freed by: kfree (mm/slub.c:6801) handle_ksmbd_work (fs/smb/server/server.c:332)
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/20/2026
The Linux kernel's SMB server implementation, specifically within the ksmbd subsystem, contained a critical race condition vulnerability related to tree connection management and file handle publication. This flaw allowed for a use-after-free scenario that could be triggered by concurrent operations during the lifecycle of an SMB tree connect request. The core issue stemmed from the ordering of operations when closing a tree connection. Previously, the system would close published file handles before marking the tree connection as disconnected or removing it from active lists. This sequence created a window where a concurrent CREATE operation, which had already acquired a reference to the tree structure, could publish its newly opened file handle after the initial close pass had begun but before the tree was fully dismantled. When this new opener subsequently dropped its reference to the tree connection, the underlying memory for that tree object could be freed while other parts of the system still held pointers or references to it via the published file handles.
This race condition manifests as a slab-use-after-free error, specifically observed in the proc_show_files function within vfs_cache.c. The vulnerability arises because asynchronous users can defer the final destruction of a file structure past the point where the tree connection is torn down. If an opener publishes its volatile ID and retains a pointer to the now-freed tree object, any subsequent access that attempts to read or process this file information will dereference invalid memory. The kernel's Kernel Address Sanitizer (KASAN) detects this as a read of size 4 at a freed address, originating from tasks handling SMB work items such as handle_ksmbd_work and smb2_tree_connect. This type of vulnerability is classified under CWE-416: Use After Free, which occurs when software uses memory after it has been freed, leading to unpredictable behavior including crashes or potential code execution if the attacker can control the reallocation of that memory region.
The operational impact of this vulnerability includes kernel panics and system instability due to the invalid memory access in proc_show_files during read operations on process file descriptors. Beyond immediate denial of service through a crash, use-after-free vulnerabilities in server-side components like ksmbd pose significant security risks. An attacker could potentially exploit the freed memory region by crafting specific SMB requests that cause the kernel to reallocate the memory with controlled data structures. This could lead to arbitrary code execution within the context of the kernel, granting full control over the host system. The vulnerability affects systems running Linux kernels where ksmbd is enabled and exposed to network traffic, particularly in environments handling untrusted or malicious SMB clients that can rapidly create and disconnect tree connections while simultaneously opening files.
To mitigate this risk, the upstream developers implemented a fix that reorders the cleanup sequence for tree connections. The critical change involves marking and removing the tree connection from active lists before closing its associated file handles. This ensures that no new operations can publish file references to a tree that is in the process of being dismantled. Furthermore, the patch introduces serialization mechanisms for both new-open and durable-reconnect volatile ID publication relative to this state transition. If an opener attempts to publish after disconnect has been initiated, it will be rejected with STATUS_NETWORK_NAME_DELETED rather than succeeding and creating a dangling pointer. Additionally, the fix ensures that tree references are kept alive as long as any file carries a pointer back to that tree, preventing premature deallocation of the tree structure even if asynchronous operations defer final destruction.
From an architectural perspective, this vulnerability highlights the complexity of managing shared state in concurrent network server implementations within the kernel space. The interaction between VFS cache management and SMB protocol handling requires strict synchronization primitives to prevent race conditions during teardown phases. Security practitioners should ensure that systems running ksmbd are updated with patches addressing CVE-2024-related fixes for this specific issue, as older versions remain susceptible to remote exploitation via crafted SMB traffic. Monitoring for unusual kernel oops messages or KASAN reports in system logs can serve as an indicator of attempted exploitation. The fix aligns with best practices for resource lifecycle management, emphasizing the importance of holding references during critical state transitions and ensuring that cleanup operations are atomic relative to concurrent accessors. This approach minimizes the attack surface by eliminating the window where invalid memory states could be exposed to user-space or other kernel subsystems like procfs.