Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-26592 Overview
CVE-2024-26592 is a use-after-free (UAF) vulnerability in the Linux kernel's ksmbd in-kernel SMB3 server. The flaw resides in the ksmbd_tcp_new_connection() function and stems from a race condition between handling a new TCP connection and its disconnection. An attacker able to trigger the race can access freed memory in struct tcp_transport, leading to kernel memory corruption. The vulnerability is tracked under CWE-416 and affects systems running ksmbd as their SMB file-sharing service.
Critical Impact
Successful exploitation can lead to kernel memory corruption, local privilege escalation, or denial of service on hosts running the ksmbd SMB server.
Affected Products
- Linux Kernel (multiple stable branches prior to the fix commits)
- Distributions shipping ksmbd as a loadable kernel module
- SMB file servers exposing ksmbd over TCP
Discovery Timeline
- 2024-02-22 - CVE-2024-26592 published to the National Vulnerability Database (NVD)
- 2026-08-04 - Last updated in NVD database
Technical Details for CVE-2024-26592
Vulnerability Analysis
The vulnerability is a classic use-after-free triggered by a race condition in the ksmbd SMB server. When a new TCP connection arrives, ksmbd_tcp_new_connection() allocates and initializes a struct tcp_transport to represent the session. If the peer disconnects while this initialization is still in progress, the disconnection path can free the tcp_transport structure before ksmbd_tcp_new_connection() finishes using it. The function then dereferences freed memory, producing undefined kernel behavior.
Because the affected structure lives in kernel heap memory, an attacker who can win the race may corrupt adjacent allocations or hijack control flow via freed object reuse. The impact includes kernel panic, denial of service, and potential local privilege escalation on hosts running ksmbd.
Root Cause
The root cause is insufficient synchronization between the new-connection setup path and the connection-teardown path in ksmbd's TCP transport layer. The lifecycle of struct tcp_transport is not protected against concurrent release during initialization, allowing the structure to be freed while another kernel thread still holds a pointer to it.
Attack Vector
The attack vector is local according to the CVSS metrics, but exploitation requires the attacker to initiate SMB connections to a vulnerable ksmbd instance and trigger rapid disconnection to win the race. An attacker with the ability to reach the SMB service and script connection churn can repeatedly attempt to hit the UAF window. Reliable exploitation typically requires precise timing and kernel heap grooming to control what occupies the freed tcp_transport slot.
No public proof-of-concept exploit was referenced in the vendor advisories. The vulnerability is addressed by the stable kernel commits listed in the patch references, which add proper synchronization around transport lifetime.
Detection Methods for CVE-2024-26592
Indicators of Compromise
- Unexpected kernel oops or panic messages referencing ksmbd_tcp_new_connection or tcp_transport in dmesg and /var/log/kern.log.
- KASAN (Kernel Address Sanitizer) reports describing use-after-free in the ksmbd module on hosts where KASAN is enabled.
- Repeated short-lived TCP connections to port 445 originating from a single source, followed by ksmbd worker crashes or restarts.
Detection Strategies
- Inventory Linux hosts and identify systems where the ksmbd module is loaded using lsmod | grep ksmbd and confirm whether the service is actively listening on TCP/445.
- Correlate kernel crash telemetry with SMB connection logs to identify abnormal connect/disconnect patterns consistent with race exploitation attempts.
- Compare running kernel versions against the fixed commits (24290ba, 380965e, 38d20c6, 69d5465, 999daf3) referenced in the kernel.org stable tree.
Monitoring Recommendations
- Monitor connection rates to TCP/445 and alert on bursts of short-duration sessions from the same source address.
- Forward kernel logs to a centralized logging platform and build detections for ksmbd-related oops signatures.
- Track module load events for ksmbd to ensure the service is only running on hosts where it is explicitly required.
How to Mitigate CVE-2024-26592
Immediate Actions Required
- Upgrade the Linux kernel to a stable release containing one of the fix commits referenced in the kernel.org advisories.
- Where patching is not immediately possible, unload the ksmbd kernel module and disable the service on hosts that do not require in-kernel SMB file sharing.
- Restrict network reachability to TCP/445 using host firewalls or network ACLs so only trusted clients can establish SMB sessions.
Patch Information
The fix is distributed across multiple stable branches of the Linux kernel. Refer to the upstream commits: Kernel Commit 24290ba, Kernel Commit 380965e, Kernel Commit 38d20c6, Kernel Commit 69d5465, and Kernel Commit 999daf3. Apply the vendor kernel update appropriate for the distribution in use.
Workarounds
- Disable ksmbd and migrate SMB file-sharing workloads to a user-space server such as Samba where feasible.
- Blocklist the ksmbd module via /etc/modprobe.d/ to prevent accidental reload after reboot.
- Enforce network segmentation so that ksmbd endpoints are only reachable from authenticated management or client subnets.
# Disable and blocklist ksmbd on affected hosts
sudo systemctl stop ksmbd.service
sudo systemctl disable ksmbd.service
sudo modprobe -r ksmbd
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/blacklist-ksmbd.conf
# Restrict SMB access at the host firewall (example: nftables)
sudo nft add rule inet filter input tcp dport 445 ip saddr != 10.0.0.0/24 drop
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

