In the Linux kernel, the following vulnerability has been resolved: smb: client: fix potential cfid UAF in smb2_query_info_compound When… (CVE-2025-40320)
A critical use-after-free vulnerability (CVE-2025-40320) was identified and resolved in the Linux kernel's SMB client code. The issue occurs in the smb2_query_info_compound() function, where a previously allocated cfid pointer may be freed during a retry attempt but not reset, leading to potential use of a stale pointer. This can cause refcount underflow and memory corruption. The fix involves reinitializing the cfid pointer to NULL during replay to prevent use-after-free.
AI Analysis
Technical Summary
CVE-2025-40320 is a use-after-free vulnerability in the Linux kernel SMB client implementation, specifically in the smb2_query_info_compound() function. When this function retries, it may operate on a cfid pointer that was freed in a previous attempt because the pointer was not reset to NULL. This stale pointer usage can lead to refcount underflow and use-after-free conditions, potentially causing memory corruption or system instability. The vulnerability has been fixed by reinitializing the cfid pointer to NULL under the replay label to prevent cleanup operations on freed memory.
Potential Impact
Successful exploitation of this vulnerability could lead to memory corruption in the Linux kernel SMB client, potentially allowing an attacker to cause a denial of service or execute arbitrary code with kernel privileges. The CVSS 3.1 base score rates this vulnerability as critical with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel. Users and administrators should apply the official kernel updates that include this patch to remediate the issue. Since this is a kernel-level vulnerability, updating to a patched kernel version is the recommended mitigation. Patch status is not explicitly confirmed in the provided data; therefore, verify the vendor advisory or Linux kernel mailing lists for the exact fixed version and apply updates accordingly.
In the Linux kernel, the following vulnerability has been resolved: smb: client: fix potential cfid UAF in smb2_query_info_compound When… (CVE-2025-40320)
Description
A critical use-after-free vulnerability (CVE-2025-40320) was identified and resolved in the Linux kernel's SMB client code. The issue occurs in the smb2_query_info_compound() function, where a previously allocated cfid pointer may be freed during a retry attempt but not reset, leading to potential use of a stale pointer. This can cause refcount underflow and memory corruption. The fix involves reinitializing the cfid pointer to NULL during replay to prevent use-after-free.
CVSS v3.1
Score 9.8critical
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-40320 is a use-after-free vulnerability in the Linux kernel SMB client implementation, specifically in the smb2_query_info_compound() function. When this function retries, it may operate on a cfid pointer that was freed in a previous attempt because the pointer was not reset to NULL. This stale pointer usage can lead to refcount underflow and use-after-free conditions, potentially causing memory corruption or system instability. The vulnerability has been fixed by reinitializing the cfid pointer to NULL under the replay label to prevent cleanup operations on freed memory.
Potential Impact
Successful exploitation of this vulnerability could lead to memory corruption in the Linux kernel SMB client, potentially allowing an attacker to cause a denial of service or execute arbitrary code with kernel privileges. The CVSS 3.1 base score rates this vulnerability as critical with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel. Users and administrators should apply the official kernel updates that include this patch to remediate the issue. Since this is a kernel-level vulnerability, updating to a patched kernel version is the recommended mitigation. Patch status is not explicitly confirmed in the provided data; therefore, verify the vendor advisory or Linux kernel mailing lists for the exact fixed version and apply updates accordingly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-2vg8-pj5q-762f
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40320"]
- Ecosystems
- []
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a6b72d49c2644c7f8479245
Added to database: 07/30/2026, 15:50:44 UTC
Last enriched: 07/30/2026, 17:52:25 UTC
Last updated: 07/31/2026, 19:24:47 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.