CVE-2025-40320
BaseFortify
Publication date: 2025-12-08
Last updated on: 2025-12-08
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a use-after-free issue in the Linux kernel's SMB client code, specifically in the smb2_query_info_compound function. When this function retries an operation, a previously allocated cfid (a client file identifier) may have been freed during the first attempt. Because the cfid was not reset to NULL before retrying, subsequent cleanup operations might act on a stale pointer, leading to a potential use-after-free condition.
How can this vulnerability impact me? :
The use-after-free vulnerability can lead to memory corruption, which may cause system instability, crashes, or potentially allow an attacker to execute arbitrary code with kernel privileges. This can compromise the security and reliability of systems running vulnerable versions of the Linux kernel.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
Detection can be done by monitoring kernel logs for warnings related to use-after-free in the smb2_query_info_compound function. Specifically, look for messages like 'refcount_t: underflow; use-after-free' and stack traces involving smb2_query_info_compound and related CIFS functions. Commands such as 'dmesg | grep -i refcount' or 'journalctl -k | grep -i smb2_query_info_compound' can help identify these warnings in the system logs.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version where the smb2_query_info_compound use-after-free issue has been fixed. Until then, avoid using SMB2 client operations that trigger smb2_query_info_compound retries. Monitoring for suspicious kernel warnings and limiting SMB client usage can reduce risk.