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-2026-98112 Overview
CVE-2026-98112 is a use-after-free vulnerability in the Linux kernel ksmbd SMB server component. The flaw affects the listener thread lifetime handling during network device (netdev) notifier events. When a netdevice notifier shuts down the listening socket, the listener thread exits and its task_struct can be freed before kthread_stop() acquires its reference. The resulting race condition allows an attacker with local access to trigger memory corruption in kernel space. Exploitation can lead to privilege escalation, denial of service, or arbitrary kernel code execution on systems running the in-kernel SMB server.
Critical Impact
A local attacker able to trigger netdev state changes while ksmbd is active can race the listener teardown path, corrupting kernel memory with potential for full system compromise.
Affected Products
- Linux kernel versions containing the ksmbd in-kernel SMB server with the vulnerable listener lifecycle logic
- Distributions shipping ksmbd as a loadable module prior to the fix commits 40581f10c1e5 and a506290f59e1
- Server and workstation deployments exposing SMB file sharing via the kernel implementation
Discovery Timeline
- 2026-09-25 - CVE-2026-98112 published to NVD
- 2026-09-30 - Last updated in NVD database
Technical Details for CVE-2026-98112
Vulnerability Analysis
The vulnerability resides in the ksmbd kernel module, which implements an in-kernel Server Message Block (SMB) server. The listener thread terminates when its listening socket is shut down. The netdevice notifier path shuts down the socket before calling kthread_stop(), which creates a window where the listener task exits and its task_struct is freed before kthread_stop() can acquire a reference to it.
This is a classic use-after-free [CWE-416] condition against a kernel task_struct. Once the structure is freed, subsequent dereferences by kthread_stop() operate on reclaimed memory. Depending on allocator state and heap grooming, this can produce a crash or allow controlled corruption of adjacent slab objects.
Root Cause
The root cause is an ordering bug in listener teardown during netdev events. The code shuts down the listening socket, which signals the kthread to exit, without first ensuring the caller holds a reference to the thread's task_struct. The exiting thread can therefore release its own task_struct before kthread_stop() runs. The fix creates the listener in a stopped state and holds an extra task_struct reference until kthread_stop_put() completes. The patches also stop and release listeners before freeing their interface records during TCP teardown.
Attack Vector
Exploitation requires local access and low privileges on a host running ksmbd with a configured listening interface. An attacker triggers netdev state transitions (for example, bringing interfaces up or down) to force the vulnerable teardown path to race with listener startup. No user interaction is required. Successful races yield kernel-mode read/write primitives against freed slab memory, which can be converted into privilege escalation or kernel code execution. See the upstream fixes in kernel commit 40581f1 and kernel commit a506290 for the authoritative technical details.
Detection Methods for CVE-2026-98112
Indicators of Compromise
- Unexpected kernel oops or panic entries in dmesg referencing ksmbd, kthread_stop, or slab-use-after-free reports from KASAN
- Repeated SMB listener restart events coinciding with network interface state changes in system logs
- Unexplained loss of SMB service availability following ip link or NetworkManager interface transitions
Detection Strategies
- Enable Kernel Address Sanitizer (KASAN) on test systems to surface use-after-free accesses against task_struct during ksmbd teardown
- Audit kernel module inventory for the presence of ksmbd.ko and verify the running kernel version against distribution advisories
- Correlate netdev notifier events with ksmbd listener lifecycle messages to identify attempted races
Monitoring Recommendations
- Collect /var/log/kern.log and journalctl -k output centrally and alert on ksmbd crash signatures
- Monitor loaded kernel modules on SMB server hosts and alert when ksmbd is loaded on systems where it should be disabled
- Track network interface state churn on servers exposing SMB, as frequent transitions can indicate exploitation attempts
How to Mitigate CVE-2026-98112
Immediate Actions Required
- Apply the upstream kernel patches referenced in commits 40581f10c1e5 and a506290f59e1 or update to a distribution kernel that includes the fix
- If patching is not immediately possible, unload the ksmbd module on systems that do not require the in-kernel SMB server
- Restrict local account access on hosts running ksmbd to reduce the pool of users capable of triggering netdev events
Patch Information
The fix is delivered in two upstream Linux kernel commits. The primary change creates the listener kthread in a stopped state and retains an additional task_struct reference until kthread_stop_put() returns. A companion change ensures listeners are stopped and released before their interface records are freed during TCP teardown. Reference the authoritative patches in kernel commit 40581f1 and kernel commit a506290.
Workarounds
- Unload the ksmbd module with modprobe -r ksmbd and blocklist it where SMB serving is not required
- Switch SMB serving to a user-space implementation such as Samba on affected hosts until the kernel is patched
- Limit permissions to execute network configuration tooling that can trigger netdev notifier events
# Verify ksmbd status and unload if not required
lsmod | grep ksmbd
systemctl stop ksmbd.service 2>/dev/null
modprobe -r ksmbd
# Prevent automatic reload
echo "blacklist ksmbd" | sudo tee /etc/modprobe.d/blacklist-ksmbd.conf
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

