CVE-2025-40090

5.5 MEDIUM

📋 TL;DR

This CVE describes a deadlock vulnerability in the Linux kernel's ksmbd SMB server module. When clients attempt to open named pipes via RPC calls, the system can hang due to recursive locking, causing denial of service. This affects Linux systems with ksmbd enabled and SMB/CIFS file sharing active.

💻 Affected Systems

Products:
  • Linux kernel with ksmbd module
Versions: Linux kernel versions after commit 305853cce3794 (introduced in v6.6) up to fix commits
Operating Systems: Linux distributions with ksmbd enabled
Default Config Vulnerable: ✅ No
Notes: Only vulnerable if ksmbd module is loaded and SMB/CIFS services are active. Many distributions don't enable ksmbd by default.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete denial of service for SMB/CIFS file sharing services, causing hung connections and potentially requiring system reboot to restore functionality.

🟠

Likely Case

SMB/CIFS clients experience connection hangs when attempting to open named pipes, disrupting file sharing operations.

🟢

If Mitigated

No impact if ksmbd module is not loaded or SMB/CIFS services are disabled.

🌐 Internet-Facing: MEDIUM - Systems with SMB/CIFS exposed to untrusted networks could experience DoS from malicious clients.
🏢 Internal Only: LOW - Internal clients could inadvertently trigger the deadlock, but impact is limited to service disruption.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: LOW - Simple RPC client commands can trigger the deadlock.

Exploitation requires SMB/CIFS access and ability to open named pipes. The vulnerability is triggered by normal client operations.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in kernel commits: 1891abe832cbf5a11039e088766131d0f1642d02, 3412fbd81b46b9cfae013817b61d4bbd27e09e36, 4602b8cee1481dbb896182e5cb1e8cf12910e9e7, 5493571f4351f74e11db9943e98a07c56467cf7e, 88f170814fea74911ceab798a43cbd7c5599bed4

Vendor Advisory: https://git.kernel.org/stable/c/1891abe832cbf5a11039e088766131d0f1642d02

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing fix commits. 2. Reboot system to load new kernel. 3. Verify ksmbd module loads correctly.

🔧 Temporary Workarounds

Disable ksmbd module

linux

Unload ksmbd kernel module to prevent exploitation

sudo rmmod ksmbd
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/ksmbd-blacklist.conf

Disable SMB/CIFS services

linux

Stop SMB/CIFS file sharing services

sudo systemctl stop smbd
sudo systemctl disable smbd

🧯 If You Can't Patch

  • Disable ksmbd module if not required for operations
  • Restrict SMB/CIFS access to trusted networks only using firewall rules

🔍 How to Verify

Check if Vulnerable:

Check if ksmbd module is loaded: lsmod | grep ksmbd. If loaded and kernel version is vulnerable range, system is vulnerable.

Check Version:

uname -r

Verify Fix Applied:

Check kernel version includes fix commits: uname -r. Verify ksmbd module loads without issues after patch.

📡 Detection & Monitoring

Log Indicators:

  • Kernel logs showing hung tasks related to ksmbd
  • SMB/CIFS connection timeouts in application logs

Network Indicators:

  • SMB/CIFS clients reporting connection hangs
  • Increased TCP timeouts on SMB ports

SIEM Query:

source="kernel" AND "hung_task" AND "ksmbd" OR source="smbd" AND "timeout" AND "pipe"

🔗 References

📤 Share & Export