Apr 10, 2026·5 min read·5 visits
A missing lock in the Linux kernel's ksmbd module allows authenticated attackers to trigger a use-after-free via concurrent SMB multi-channel requests, leading to kernel-level code execution or denial of service.
CVE-2026-23226 is a high-severity use-after-free vulnerability in the Linux kernel's in-kernel SMB server (ksmbd). The flaw arises from a missing synchronization lock in the multi-channel session management code, specifically within the ksmbd_chann_list xarray. Successful exploitation allows an authenticated network attacker to achieve arbitrary code execution, kernel panics, or information disclosure.
The ksmbd module is an in-kernel SMB server implemented in the Linux kernel to handle SMB3 protocol operations. It is designed to provide high-performance network file sharing capabilities directly from kernel space. This architecture inherently expands the kernel attack surface to network-based operations originating from SMB clients.
CVE-2026-23226 is a critical use-after-free (UAF) vulnerability located within the multi-channel session management code of ksmbd. The multi-channel feature allows a single SMB session to utilize multiple network connections simultaneously for increased throughput and fault tolerance. The core issue arises from the mismanagement of concurrent channel access.
Specifically, the vulnerability is classified as CWE-416: Use After Free. The severity is rated High (CVSS 8.8) because it allows an authenticated network attacker to induce memory corruption. Successful exploitation results in arbitrary code execution within the context of the kernel, complete system compromise, or a persistent denial-of-service state via kernel panic.
The root cause of CVE-2026-23226 is a concurrency flaw involving the ksmbd_chann_list data structure. This structure is implemented as an xarray and is embedded within the ksmbd_session struct to track active channels associated with a specific SMB session. The xarray is accessed by multiple kernel threads during standard SMB multi-channel operations.
The vulnerability exists because access to this xarray is not protected by sufficient synchronization primitives, such as a mutex or a read-write semaphore. A race condition is created between the function lookup_chann_list(), which retrieves a pointer to a channel object, and ksmbd_chann_del(), which removes the object from the xarray and releases its memory back to the allocator.
During concurrent operations, thread A can execute lookup_chann_list() and obtain a valid pointer to a channel object. Before thread A can utilize this pointer, thread B executes ksmbd_chann_del() on the same object. The kernel frees the memory associated with the channel. When execution returns to thread A, it performs operations on the now-freed memory address, triggering the use-after-free condition.
The patch for CVE-2026-23226 introduces a dedicated read-write semaphore to enforce synchronized access to the ksmbd_chann_list xarray. The structure ksmbd_session is modified to include a new member chann_lock of type struct rw_semaphore. This semaphore is initialized when a new session is created.
/* Patch introducing rw_semaphore to ksmbd_session */
struct ksmbd_session {
// ... other members
struct xarray ksmbd_chann_list;
+ struct rw_semaphore chann_lock;
// ...
};All operations that modify or access the xarray are now wrapped within locking operations. Functions performing xa_load utilize down_read(&sess->chann_lock) and up_read(&sess->chann_lock). Functions performing xa_store or xa_erase utilize down_write(&sess->chann_lock) and up_write(&sess->chann_lock). This ensures that a channel object cannot be deleted while it is actively being retrieved or processed by another thread.
/* Example of patched ksmbd_chann_del */
+ down_write(&sess->chann_lock);
xa_erase(&sess->ksmbd_chann_list, chann->id);
+ up_write(&sess->chann_lock);
kfree(chann);By enforcing this locking discipline, the kernel guarantees mutual exclusion between lookup and deletion operations. The race window is entirely eliminated. An attacker can no longer manipulate timing to force a thread to operate on a freed channel pointer.
Exploitation of CVE-2026-23226 requires the attacker to possess valid credentials to authenticate to the ksmbd service. The required privileges are low, as any valid user account capable of establishing an SMB session can interact with the multi-channel implementation. The attacker must also have network access to the exposed SMB port (typically TCP 445).
The attacker initiates the exploit by establishing a primary SMB session and explicitly requesting multi-channel capabilities. The attacker then scripts a rapid sequence of concurrent requests designed to create multiple secondary channels and immediately tear them down. This concurrent creation and deletion floods the ksmbd handler threads.
The goal of this request flood is to align the execution of lookup_chann_list() and ksmbd_chann_del() across two separate CPU cores. When the race condition is won, the kernel references the freed memory. Advanced exploitation involves using heap spraying techniques within the kernel allocator (SLUB) to replace the freed channel object with attacker-controlled data before the original pointer is dereferenced, enabling execution flow hijacking.
The primary remediation for CVE-2026-23226 is applying the official kernel updates. System administrators must upgrade affected Linux kernel installations to versions 6.18.11, 6.19.1, or the 7.0-rc1 mainline branch. These releases contain the necessary synchronization primitives to prevent the use-after-free condition.
In environments where immediate kernel patching is operationally unfeasible, administrators can apply configuration-based workarounds. The most effective mitigation is to disable SMB multi-channel support entirely within the ksmbd configuration. This prevents the execution of the vulnerable code paths associated with ksmbd_chann_list.
Alternatively, if ksmbd is not strictly required for the system's operational role, the module should be unloaded or disabled entirely. Network-level mitigations include restricting access to TCP port 445 using firewalls or access control lists (ACLs) to ensure only highly trusted network segments can interact with the SMB service.
The following diagram illustrates the concurrent execution flow that leads to the use-after-free condition. It details the interaction between the two threads and the unprotected ksmbd_chann_list xarray.
This visualization underscores the strict timing requirements of the exploit. Thread 1 must obtain the pointer before Thread 2 removes it from the xarray, but Thread 1 must delay its dereference until after Thread 2 has executed the kernel free routine.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Linux Kernel Linux Foundation | >= 6.3, < 6.18.11 | 6.18.11 |
Linux Kernel Linux Foundation | >= 6.19, < 6.19.1 | 6.19.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-416 |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 | 8.8 |
| EPSS Score | 0.00021 |
| Impact | Remote Code Execution / DoS |
| Exploit Status | Proof of Concept |
| KEV Status | Not Listed |
Referencing memory after it has been freed, which can cause a program to crash, use unexpected values, or execute code.