Use-After-Free Vulnerability in Linux Kernel's ksmbd Package
Summary
CVE-2025-21945: In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix use-after-free in smb2_lock If smb_lock->zero_len has value, ->llist of smb_lock is not delete and flock is old one. Affects linux versions < 6.1.133-1. Fixed in 6.1.133-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux kernel is the core component of many operating systems, providing essential functionalities such as process management, memory management, and hardware abstraction. The ksmbd module is responsible for implementing the SMB protocol, allowing file sharing and printing services over a network. This module is crucial for enabling interoperability between Linux and Windows systems. However, it is susceptible to vulnerabilities that can compromise system stability and security.
Vulnerability Detail
In the Linux kernel, a use-after-free vulnerability has been identified in the ksmbd module related to the smb2_lock functionality. Specifically, if the smb_lock->zero_len attribute is set, the linked list associated with smb_lock is not deleted, leading to a situation where an old file lock (flock) is still referenced. This can result in a use-after-free condition during error handling, potentially allowing an attacker to exploit this flaw to execute arbitrary code or crash the system.
How To Fix
Minimum fixed version
6.1.133-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade linux
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
Currently, there are no specific workarounds mentioned for this vulnerability. It is advisable to apply the patch as soon as it becomes available for your distribution.
Conclusion
The use-after-free vulnerability in the ksmbd module of the Linux kernel poses significant risks to system security and stability. Users are urged to update their systems to the patched version as soon as it becomes available. Regular monitoring for vulnerabilities using tools like Vulert can help maintain system integrity.
See every vulnerability recorded for linux →
FAQ
A use-after-free vulnerability occurs when a program continues to use a memory reference after it has been freed, potentially leading to arbitrary code execution or crashes.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The vulnerability can lead to system crashes or allow attackers to execute arbitrary code, compromising the security and stability of the affected system.
Currently, a fixed version is available for Debian 13 (6.12.19-1). For Debian 11 and 12, users should monitor for updates as patches may not yet be available.
While there are no specific workarounds, it is crucial to monitor for updates and apply them as soon as they are released to mitigate the risk.
Related vulnerabilities
Recent vulnerabilities recorded for linux.