CVE-2025-40320
Linux Kernel vulnerability analysis and mitigation

Overview

CVE-2025-40320 is a use-after-free (UAF) vulnerability in the Linux kernel's SMB client (cifs module), specifically within the smb2_query_info_compound() function. When this function retries a request, a previously allocated cfid (cached file ID) pointer may have already been freed during the first attempt; because cfid was not reset to NULL under the replay label, subsequent cleanup operations act on a stale pointer, triggering a UAF condition. The vulnerability was disclosed on December 8, 2025, and affects Linux kernel versions from 6.8 up to the patched releases (6.6.117, 6.12.58, 6.17.8, and 6.18). It carries a CVSS v3.1 base score of 7.0 (High) (Red Hat CVE, Red Hat Bugzilla).

Technical details

The root cause is a use-after-free memory error (CWE-416) in the Linux kernel's CIFS/SMB2 client implementation. In smb2_query_info_compound(), when a retry (replay) occurs after a failed first attempt, the cfid pointer is not reinitialized to NULL before re-entering the retry path. If the cfid was freed during the first attempt, the retry path operates on a dangling pointer, leading to a refcount underflow and potential UAF. The vulnerability is triggered locally by a low-privileged user invoking filesystem operations such as statfs() on an SMB-mounted share, as evidenced by the kernel call trace: cifs_statfssmb311_queryfssmb2_queryfssmb2_query_info_compound. The fix reinitializes cfid to NULL under the replay label (Red Hat Bugzilla, Red Hat CVE).

Impact

Successful exploitation of this vulnerability can result in high confidentiality, integrity, and availability impact on the affected system, as reflected in the CVSS score. A local attacker with low privileges could leverage the UAF condition to read sensitive kernel memory, corrupt kernel data structures, or crash the system (kernel panic). In worst-case scenarios, this class of vulnerability can be chained with other primitives to achieve local privilege escalation (Red Hat CVE, Red Hat Bugzilla).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported for CVE-2025-40320. The vulnerability requires local access with low privileges and high attack complexity, limiting its immediate exploitability. The EPSS score is approximately 0.018% (0.000180), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (Red Hat CVE).

Mitigation and workarounds

The Linux kernel maintainers have released patches addressing this vulnerability in stable branches: versions 6.6.117, 6.12.58, 6.17.8, and 6.18. For Red Hat Enterprise Linux 10, the fix is included in RHSA-2026:18134. Administrators should update to a patched kernel version as soon as possible. As a temporary workaround where patching is not immediately feasible, restricting or disabling SMB/CIFS mounts for untrusted local users can reduce exposure (Red Hat Bugzilla, Red Hat Errata).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-68427MEDIUM5.5
  • Linux Kernel logoLinux Kernel
  • linux-nvidia-tegra
NoYesAug 10, 2026
CVE-2026-68426MEDIUM4.7
  • Linux Kernel logoLinux Kernel
  • linux-nvidia-tegra-igx
NoYesAug 10, 2026
CVE-2026-68450NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel-debug-devel
NoYesAug 12, 2026
CVE-2026-68430NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel-rt-64k-debug-modules-partner
NoYesAug 12, 2026
CVE-2026-68428NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux-ibm-6.8
NoYesAug 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management